xiaobai
3 years ago
43 changed files with 3655 additions and 5312 deletions
@ -0,0 +1,9 @@ |
|||||
|
import api from '@/utils/api' |
||||
|
import qs from 'qs' |
||||
|
|
||||
|
export function initData(url, params) { |
||||
|
return api({ |
||||
|
url: url + '?' + qs.stringify(params, { indices: false }), |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
import api from '@/utils/api' |
||||
|
|
||||
|
export function add(data) { |
||||
|
return api({ |
||||
|
url: '/dicData', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function edit(data) { |
||||
|
return api({ |
||||
|
url: '/dicData', |
||||
|
method: 'put', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function del(id) { |
||||
|
return api({ |
||||
|
url: '/dicData/' + id, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getAllDicData() { |
||||
|
return api({ |
||||
|
url: '/dicData/getAll', |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getDicDataListByTypeName(typeName) { |
||||
|
return api({ |
||||
|
url: '/dicData/getDicDataListByTypeName/' + typeName, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { add, edit, del, getAllDicData } |
@ -0,0 +1,46 @@ |
|||||
|
import api from '@/utils/api' |
||||
|
import qs from 'qs' |
||||
|
|
||||
|
export function add(data) { |
||||
|
return api({ |
||||
|
url: '/instrument', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function edit(data) { |
||||
|
return api({ |
||||
|
url: '/instrument', |
||||
|
method: 'put', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function del(params) { |
||||
|
return api({ |
||||
|
url: '/instrument', |
||||
|
method: 'delete', |
||||
|
params, |
||||
|
paramsSerializer: function(params) { |
||||
|
return qs.stringify(params, { indices: false }) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getDepartmentStatistical() { |
||||
|
return api({ |
||||
|
url: '/instrument/getDepartmentStatistical', |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function exportExcel(params) { |
||||
|
return api({ |
||||
|
url: '/instrument/exportExcel' + '?' + qs.stringify(params, { indices: false }), |
||||
|
method: 'get', |
||||
|
responseType: 'blob' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { add, edit, del, exportExcel } |
@ -0,0 +1,31 @@ |
|||||
|
import api from '@/utils/api' |
||||
|
import qs from 'qs' |
||||
|
|
||||
|
export function add(data) { |
||||
|
return api({ |
||||
|
url: '/move', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function edit(data) { |
||||
|
return api({ |
||||
|
url: '/move', |
||||
|
method: 'put', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function del(params) { |
||||
|
return api({ |
||||
|
url: '/move', |
||||
|
method: 'delete', |
||||
|
params, |
||||
|
paramsSerializer: function(params) { |
||||
|
return qs.stringify(params, { indices: false }) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { add, edit, del } |
@ -0,0 +1,52 @@ |
|||||
|
import api from '@/utils/api' |
||||
|
import qs from 'qs' |
||||
|
|
||||
|
export function add(data) { |
||||
|
return api({ |
||||
|
url: '/role', |
||||
|
method: 'post', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function edit(data) { |
||||
|
return api({ |
||||
|
url: '/role', |
||||
|
method: 'put', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
export function del(params) { |
||||
|
return api({ |
||||
|
url: '/role', |
||||
|
method: 'delete', |
||||
|
params, |
||||
|
paramsSerializer: function(params) { |
||||
|
return qs.stringify(params, { indices: false }) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getRoleList(params) { |
||||
|
return api({ |
||||
|
url: '/role', |
||||
|
method: 'get', |
||||
|
params |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getRoleMenuList(roleId) { |
||||
|
return api({ |
||||
|
url: '/role/getRoleMenuList/' + roleId, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function getAllRole() { |
||||
|
return api({ |
||||
|
url: '/role/getAllRole', |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { add, edit, del, getRoleMenuList } |
@ -0,0 +1,70 @@ |
|||||
|
<template> |
||||
|
<el-popover v-model="pop" placement="top" width="180" trigger="manual" @show="onPopoverShow" @hide="onPopoverHide"> |
||||
|
<p>{{ msg }}</p> |
||||
|
<div style="text-align: right; margin: 0"> |
||||
|
<el-button type="text" @click="doCancel"> |
||||
|
取消 |
||||
|
</el-button> |
||||
|
<el-button type="primary" @click="crud.doDelete(data)"> |
||||
|
确定 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
<el-button slot="reference" :disabled="disabledDel" type="text" @click="toDelete"> |
||||
|
删除 |
||||
|
</el-button> |
||||
|
</el-popover> |
||||
|
</template> |
||||
|
<script> |
||||
|
import CRUD, { crud } from '@/components/Crud/crud' |
||||
|
export default { |
||||
|
mixins: [crud()], |
||||
|
props: { |
||||
|
data: { |
||||
|
type: Object, |
||||
|
required: true |
||||
|
}, |
||||
|
permission: { |
||||
|
type: Object, |
||||
|
required: true |
||||
|
}, |
||||
|
disabledDel: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
msg: { |
||||
|
type: String, |
||||
|
default: '确定删除本条数据吗?' |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
pop: false |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
doCancel() { |
||||
|
this.pop = false |
||||
|
this.crud.cancelDelete(this.data) |
||||
|
}, |
||||
|
toDelete() { |
||||
|
this.pop = true |
||||
|
}, |
||||
|
[CRUD.HOOK.afterDelete](crud, data) { |
||||
|
if (data === this.data) { |
||||
|
this.pop = false |
||||
|
} |
||||
|
}, |
||||
|
onPopoverShow() { |
||||
|
setTimeout(() => { |
||||
|
document.addEventListener('click', this.handleDocumentClick) |
||||
|
}, 0) |
||||
|
}, |
||||
|
onPopoverHide() { |
||||
|
document.removeEventListener('click', this.handleDocumentClick) |
||||
|
}, |
||||
|
handleDocumentClick() { |
||||
|
this.pop = false |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,21 @@ |
|||||
|
<template> |
||||
|
<el-button type="text" :disabled="disabledEdit" icon="edit" @click="crud.toEdit(data)"> |
||||
|
修改 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { crud } from '@/components/Crud/crud' |
||||
|
export default { |
||||
|
mixins: [crud()], |
||||
|
props: { |
||||
|
data: { |
||||
|
type: Object, |
||||
|
required: true |
||||
|
}, |
||||
|
disabledEdit: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,20 @@ |
|||||
|
<!--分页--> |
||||
|
<template> |
||||
|
<el-pagination |
||||
|
background |
||||
|
:page-size.sync="page.pageSize" |
||||
|
:total="page.total" |
||||
|
:current-page.sync="page.pageNum" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
style="margin-top: 8px;" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
@size-change="crud.sizeChangeHandler($event)" |
||||
|
@current-change="crud.pageChangeHandler" |
||||
|
/> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { pagination } from '@/components/Crud/crud' |
||||
|
export default { |
||||
|
mixins: [pagination()] |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,17 @@ |
|||||
|
<!--搜索与重置--> |
||||
|
<template> |
||||
|
<span> |
||||
|
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="crud.toQuery">查询</el-button> |
||||
|
<el-button class="filter-item" type="warning" icon="el-icon-refresh-left" @click="crud.resetQuery()">重置</el-button> |
||||
|
</span> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
crud: { |
||||
|
type: Object, |
||||
|
required: true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,115 @@ |
|||||
|
<template> |
||||
|
<el-table |
||||
|
ref="table" |
||||
|
v-adaptive="{bottomOffset: 45}" |
||||
|
height="100px" |
||||
|
:data="crud.data" |
||||
|
:row-class-name="rowClassName" |
||||
|
border |
||||
|
fit |
||||
|
highlight-current-row |
||||
|
stripe |
||||
|
:row-key="rowKey" |
||||
|
:default-expand-all="expandAll" |
||||
|
:tree-props="treeProps" |
||||
|
@row-click="crud.rowClickHandler" |
||||
|
@selection-change="crud.selectionChangeHandler" |
||||
|
> |
||||
|
<!-- 列表公共列 --> |
||||
|
<el-table-column v-if="selection" type="selection" width="40" /> |
||||
|
<el-table-column align="center" type="index" label="序号" width="80" /> |
||||
|
<template v-for="colConfig in colConfigs"> |
||||
|
<!-- 操作按钮插槽 --> |
||||
|
<slot v-if="colConfig.slot" :name="colConfig.slot" /> |
||||
|
<!-- 无自定义内容列 --> |
||||
|
<el-table-column |
||||
|
v-else-if="columns.visible(colConfig.prop) && !colConfig.component" |
||||
|
:key="colConfig.prop" |
||||
|
:prop="colConfig.prop" |
||||
|
:align="colConfig.align" |
||||
|
:sortable="colConfig.sortable" |
||||
|
:label="colConfig.label" |
||||
|
:min-width="colConfig.width" |
||||
|
:formatter="colConfig.formatter" |
||||
|
:show-overflow-tooltip="colConfig.showOverflowTooltip" |
||||
|
/> |
||||
|
<!-- 有自定义内容列 --> |
||||
|
<el-table-column |
||||
|
v-else-if="columns.visible(colConfig.prop) && colConfig.component" |
||||
|
:key="colConfig.prop" |
||||
|
:prop="colConfig.prop" |
||||
|
:align="colConfig.align" |
||||
|
:sortable="colConfig.sortable" |
||||
|
:min-width="colConfig.width" |
||||
|
:label="colConfig.label" |
||||
|
:show-overflow-tooltip="colConfig.showOverflowTooltip" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<component |
||||
|
:is="colConfig.component" |
||||
|
:key="colConfig.prop" |
||||
|
:row="scope.row" |
||||
|
:prop="colConfig.prop" |
||||
|
:value="scope.row[colConfig.prop]" |
||||
|
:functions="colConfig.componentFunction" |
||||
|
/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</template> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import adaptive from '@/directive/el-table' |
||||
|
export default { |
||||
|
directives: { adaptive }, |
||||
|
props: { |
||||
|
colConfigs: { |
||||
|
required: true, |
||||
|
type: Array |
||||
|
}, |
||||
|
crud: { |
||||
|
required: true, |
||||
|
type: Object |
||||
|
}, |
||||
|
columns: { |
||||
|
required: true, |
||||
|
type: Object |
||||
|
}, |
||||
|
width: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
expandAll: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
treeProps: { |
||||
|
type: Object, |
||||
|
default: function() { |
||||
|
return { children: 'children', hasChildren: 'hasChildren' } |
||||
|
} |
||||
|
}, |
||||
|
rowKey: { |
||||
|
type: String, |
||||
|
default: 'id' |
||||
|
}, |
||||
|
selection: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
rowClassName: { |
||||
|
type: Function, |
||||
|
default: () => { return '' } |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.el-table .table-row-color-red { |
||||
|
color: red; |
||||
|
} |
||||
|
.el-table .table-row-color-orange { |
||||
|
color: #FF8C00; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,740 @@ |
|||||
|
import { initData } from '@/api/data' |
||||
|
import Vue from 'vue' |
||||
|
|
||||
|
/** |
||||
|
* CRUD 配置 |
||||
|
* @param options |
||||
|
* @author zhoujl fork by eladmin |
||||
|
*/ |
||||
|
function CRUD(options) { |
||||
|
const defaultOptions = { |
||||
|
// 标题
|
||||
|
title: '', |
||||
|
// 请求数据的url
|
||||
|
url: '', |
||||
|
// 表格数据
|
||||
|
data: [], |
||||
|
// 选择项
|
||||
|
selections: [], |
||||
|
// 待查询的对象
|
||||
|
query: {}, |
||||
|
// 查询数据的参数
|
||||
|
params: {}, |
||||
|
// Form 表单
|
||||
|
form: {}, |
||||
|
// 重置表单
|
||||
|
defaultForm: () => {}, |
||||
|
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
||||
|
orderBy: ['id,desc'], |
||||
|
// 等待时间
|
||||
|
time: 50, |
||||
|
// CRUD Method
|
||||
|
crudMethod: { |
||||
|
add: (form) => {}, |
||||
|
delete: (id) => {}, |
||||
|
edit: (form) => {}, |
||||
|
get: (id) => {} |
||||
|
}, |
||||
|
// 主页操作栏显示哪些按钮
|
||||
|
optionShow: { |
||||
|
add: true, |
||||
|
edit: true, |
||||
|
del: true |
||||
|
}, |
||||
|
// 自定义一些扩展属性
|
||||
|
props: {}, |
||||
|
// 在主页准备
|
||||
|
queryOnPresenterCreated: true, |
||||
|
// 调试开关
|
||||
|
debug: false |
||||
|
} |
||||
|
options = mergeOptions(defaultOptions, options) |
||||
|
// 定义数据
|
||||
|
const data = { |
||||
|
...options, |
||||
|
// 记录数据状态
|
||||
|
dataStatus: {}, |
||||
|
status: { |
||||
|
add: CRUD.STATUS.NORMAL, |
||||
|
edit: CRUD.STATUS.NORMAL, |
||||
|
// 添加或编辑状态
|
||||
|
get editor() { |
||||
|
if (this.add === CRUD.STATUS.NORMAL && this.edit === CRUD.STATUS.NORMAL) { |
||||
|
return CRUD.STATUS.NORMAL |
||||
|
} else if (this.add === CRUD.STATUS.PREPARED || this.edit === CRUD.STATUS.PREPARED) { |
||||
|
return CRUD.STATUS.PREPARED |
||||
|
} else if (this.add === CRUD.STATUS.PROCESSING || this.edit === CRUD.STATUS.PROCESSING) { |
||||
|
return CRUD.STATUS.PROCESSING |
||||
|
} |
||||
|
throw new Error('wrong crud\'s editor status') |
||||
|
}, |
||||
|
// 标题
|
||||
|
get title() { |
||||
|
return this.add > CRUD.STATUS.NORMAL ? `新增${crud.title}` : this.edit > CRUD.STATUS.NORMAL ? `编辑${crud.title}` : crud.title |
||||
|
} |
||||
|
}, |
||||
|
msg: { |
||||
|
submit: '提交成功', |
||||
|
add: '新增成功', |
||||
|
edit: '编辑成功', |
||||
|
del: '删除成功' |
||||
|
}, |
||||
|
page: { |
||||
|
// 页码
|
||||
|
pageNum: 1, |
||||
|
// 每页数据条数
|
||||
|
pageSize: 20, |
||||
|
// 总数据条数
|
||||
|
total: 0 |
||||
|
} |
||||
|
} |
||||
|
const methods = { |
||||
|
/** |
||||
|
* 通用的提示 |
||||
|
*/ |
||||
|
submitSuccessNotify() { |
||||
|
crud.notify(crud.msg.submit, CRUD.NOTIFICATION_TYPE.SUCCESS) |
||||
|
}, |
||||
|
addSuccessNotify() { |
||||
|
crud.notify(crud.msg.add, CRUD.NOTIFICATION_TYPE.SUCCESS) |
||||
|
}, |
||||
|
editSuccessNotify() { |
||||
|
crud.notify(crud.msg.edit, CRUD.NOTIFICATION_TYPE.SUCCESS) |
||||
|
}, |
||||
|
delSuccessNotify() { |
||||
|
crud.notify(crud.msg.del, CRUD.NOTIFICATION_TYPE.SUCCESS) |
||||
|
}, |
||||
|
// 搜索
|
||||
|
toQuery() { |
||||
|
crud.page.pageNum = 1 |
||||
|
crud.refresh() |
||||
|
}, |
||||
|
// 刷新
|
||||
|
refresh() { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeRefresh)) { |
||||
|
return |
||||
|
} |
||||
|
return new Promise((resolve) => { |
||||
|
// 请求数据
|
||||
|
initData(crud.url, crud.getQueryParams()).then(data => { |
||||
|
crud.page.total = data.total |
||||
|
if (data.list) { |
||||
|
crud.data = data.list |
||||
|
} else { |
||||
|
crud.data = data |
||||
|
} |
||||
|
crud.resetDataStatus() |
||||
|
// time 毫秒后显示表格
|
||||
|
setTimeout(() => { |
||||
|
callVmHook(crud, CRUD.HOOK.afterRefresh) |
||||
|
}, crud.time) |
||||
|
resolve(data) |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 启动添加 |
||||
|
*/ |
||||
|
toAdd() { |
||||
|
if (!(callVmHook(crud, CRUD.HOOK.beforeToAdd, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) { |
||||
|
return |
||||
|
} |
||||
|
crud.status.add = CRUD.STATUS.PREPARED |
||||
|
callVmHook(crud, CRUD.HOOK.afterToAdd, crud.form) |
||||
|
callVmHook(crud, CRUD.HOOK.afterToCU, crud.form) |
||||
|
}, |
||||
|
/** |
||||
|
* 启动编辑 |
||||
|
* @param {*} data 数据项 |
||||
|
*/ |
||||
|
toEdit(data) { |
||||
|
crud.resetForm(JSON.parse(JSON.stringify(data))) |
||||
|
if (!(callVmHook(crud, CRUD.HOOK.beforeToEdit, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) { |
||||
|
return |
||||
|
} |
||||
|
crud.status.edit = CRUD.STATUS.PREPARED |
||||
|
crud.getDataStatus(data.id).edit = CRUD.STATUS.PREPARED |
||||
|
callVmHook(crud, CRUD.HOOK.afterToEdit, crud.form) |
||||
|
callVmHook(crud, CRUD.HOOK.afterToCU, crud.form) |
||||
|
}, |
||||
|
/** |
||||
|
* 启动删除 |
||||
|
* @param {*} data 数据项 |
||||
|
*/ |
||||
|
toDelete(data) { |
||||
|
crud.getDataStatus(data.id).delete = CRUD.STATUS.PREPARED |
||||
|
}, |
||||
|
/** |
||||
|
* 取消删除 |
||||
|
* @param {*} data 数据项 |
||||
|
*/ |
||||
|
cancelDelete(data) { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeDeleteCancel, data)) { |
||||
|
return |
||||
|
} |
||||
|
crud.getDataStatus(data.id).delete = CRUD.STATUS.NORMAL |
||||
|
callVmHook(crud, CRUD.HOOK.afterDeleteCancel, data) |
||||
|
}, |
||||
|
/** |
||||
|
* 取消新增/编辑 |
||||
|
*/ |
||||
|
cancelCU() { |
||||
|
const addStatus = crud.status.add |
||||
|
const editStatus = crud.status.edit |
||||
|
if (addStatus === CRUD.STATUS.PREPARED) { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeAddCancel, crud.form)) { |
||||
|
return |
||||
|
} |
||||
|
crud.status.add = CRUD.STATUS.NORMAL |
||||
|
} |
||||
|
if (editStatus === CRUD.STATUS.PREPARED) { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeEditCancel, crud.form)) { |
||||
|
return |
||||
|
} |
||||
|
crud.status.edit = CRUD.STATUS.NORMAL |
||||
|
crud.getDataStatus(crud.form.id).edit = CRUD.STATUS.NORMAL |
||||
|
} |
||||
|
crud.resetForm() |
||||
|
if (addStatus === CRUD.STATUS.PREPARED) { |
||||
|
callVmHook(crud, CRUD.HOOK.afterAddCancel, crud.form) |
||||
|
} |
||||
|
if (editStatus === CRUD.STATUS.PREPARED) { |
||||
|
callVmHook(crud, CRUD.HOOK.afterEditCancel, crud.form) |
||||
|
} |
||||
|
// 清除表单验证
|
||||
|
if (crud.findVM('form').$refs['form']) { |
||||
|
crud.findVM('form').$refs['form'].clearValidate() |
||||
|
} |
||||
|
}, |
||||
|
/** |
||||
|
* 提交新增/编辑 |
||||
|
*/ |
||||
|
submitCU() { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeValidateCU)) { |
||||
|
return |
||||
|
} |
||||
|
crud.findVM('form').$refs['form'].validate(valid => { |
||||
|
if (!valid) { |
||||
|
return |
||||
|
} |
||||
|
if (!callVmHook(crud, CRUD.HOOK.afterValidateCU)) { |
||||
|
return |
||||
|
} |
||||
|
if (crud.status.add === CRUD.STATUS.PREPARED) { |
||||
|
crud.doAdd() |
||||
|
} else if (crud.status.edit === CRUD.STATUS.PREPARED) { |
||||
|
crud.doEdit() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 执行添加 |
||||
|
*/ |
||||
|
doAdd() { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeSubmit)) { |
||||
|
return |
||||
|
} |
||||
|
crud.status.add = CRUD.STATUS.PROCESSING |
||||
|
crud.crudMethod.add(crud.form).then(() => { |
||||
|
crud.status.add = CRUD.STATUS.NORMAL |
||||
|
crud.resetForm() |
||||
|
crud.addSuccessNotify() |
||||
|
callVmHook(crud, CRUD.HOOK.afterSubmit) |
||||
|
crud.toQuery() |
||||
|
}).catch(() => { |
||||
|
crud.status.add = CRUD.STATUS.PREPARED |
||||
|
callVmHook(crud, CRUD.HOOK.afterAddError) |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 执行编辑 |
||||
|
*/ |
||||
|
doEdit() { |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeSubmit)) { |
||||
|
return |
||||
|
} |
||||
|
crud.status.edit = CRUD.STATUS.PROCESSING |
||||
|
crud.crudMethod.edit(crud.form).then(() => { |
||||
|
crud.status.edit = CRUD.STATUS.NORMAL |
||||
|
crud.getDataStatus(crud.form.id).edit = CRUD.STATUS.NORMAL |
||||
|
crud.editSuccessNotify() |
||||
|
crud.resetForm() |
||||
|
callVmHook(crud, CRUD.HOOK.afterSubmit) |
||||
|
crud.refresh() |
||||
|
}).catch(() => { |
||||
|
crud.status.edit = CRUD.STATUS.PREPARED |
||||
|
callVmHook(crud, CRUD.HOOK.afterEditError) |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 执行删除 |
||||
|
* @param {*} data 数据项 |
||||
|
*/ |
||||
|
doDelete(data) { |
||||
|
let delAll = false |
||||
|
let dataStatus |
||||
|
const ids = [] |
||||
|
let singleId = 0 |
||||
|
if (data instanceof Array) { |
||||
|
delAll = true |
||||
|
data.forEach(val => { |
||||
|
ids.push(val.id) |
||||
|
}) |
||||
|
} else { |
||||
|
singleId = data.id |
||||
|
dataStatus = crud.getDataStatus(data.id) |
||||
|
} |
||||
|
if (!callVmHook(crud, CRUD.HOOK.beforeDelete, data)) { |
||||
|
return |
||||
|
} |
||||
|
if (!delAll) { |
||||
|
dataStatus.delete = CRUD.STATUS.PROCESSING |
||||
|
} |
||||
|
return crud.crudMethod.del(delAll ? { idArray: ids } : singleId).then(() => { |
||||
|
if (!delAll) { |
||||
|
dataStatus.delete = CRUD.STATUS.PREPARED |
||||
|
} |
||||
|
crud.dleChangePage(1) |
||||
|
crud.delSuccessNotify() |
||||
|
callVmHook(crud, CRUD.HOOK.afterDelete, data) |
||||
|
crud.refresh() |
||||
|
}).catch(() => { |
||||
|
if (!delAll) { |
||||
|
dataStatus.delete = CRUD.STATUS.PREPARED |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
/** |
||||
|
* 获取查询参数 |
||||
|
*/ |
||||
|
getQueryParams: function() { |
||||
|
return { |
||||
|
pageNum: crud.page.pageNum, |
||||
|
pageSize: crud.page.pageSize, |
||||
|
orderBy: crud.orderBy, |
||||
|
...crud.query, |
||||
|
...crud.params |
||||
|
} |
||||
|
}, |
||||
|
// 当前页改变
|
||||
|
pageChangeHandler(e) { |
||||
|
crud.page.pageNum = e |
||||
|
crud.refresh() |
||||
|
}, |
||||
|
// 每页条数改变
|
||||
|
sizeChangeHandler(e) { |
||||
|
crud.page.pageSize = e |
||||
|
crud.page.pageNum = 1 |
||||
|
crud.refresh() |
||||
|
}, |
||||
|
// 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据
|
||||
|
dleChangePage(size) { |
||||
|
if (crud.data.length === size && crud.page.pageNum !== 1) { |
||||
|
crud.page.pageNum -= 1 |
||||
|
} |
||||
|
}, |
||||
|
// 选择改变
|
||||
|
selectionChangeHandler(val) { |
||||
|
crud.selections = val |
||||
|
}, |
||||
|
// 点击行选中
|
||||
|
rowClickHandler(row) { |
||||
|
crud.findVM('presenter').$refs['customTable'].$refs['table'].toggleRowSelection(row) |
||||
|
callVmHook(crud, CRUD.HOOK.afterRowClick, row) |
||||
|
}, |
||||
|
/** |
||||
|
* 重置查询参数 |
||||
|
* @param {Boolean} toQuery 重置后进行查询操作 |
||||
|
*/ |
||||
|
resetQuery(toQuery = true) { |
||||
|
const defaultQuery = JSON.parse(JSON.stringify(crud.defaultQuery)) |
||||
|
const query = crud.query |
||||
|
Object.keys(query).forEach(key => { |
||||
|
query[key] = defaultQuery[key] |
||||
|
}) |
||||
|
if (toQuery) { |
||||
|
crud.toQuery() |
||||
|
} |
||||
|
callVmHook(crud, CRUD.HOOK.afterResetQuery) |
||||
|
}, |
||||
|
/** |
||||
|
* 重置表单 |
||||
|
* @param {Array} data 数据 |
||||
|
*/ |
||||
|
resetForm(data) { |
||||
|
const form = data || (typeof crud.defaultForm === 'object' ? JSON.parse(JSON.stringify(crud.defaultForm)) : crud.defaultForm()) |
||||
|
const crudFrom = crud.form |
||||
|
for (const key in form) { |
||||
|
if (Object.prototype.hasOwnProperty.call(form, key)) { |
||||
|
if (Object.prototype.hasOwnProperty.call(crudFrom, key)) { |
||||
|
crudFrom[key] = form[key] |
||||
|
} else { |
||||
|
Vue.set(crudFrom, key, form[key]) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
/** |
||||
|
* 重置数据状态 |
||||
|
*/ |
||||
|
resetDataStatus() { |
||||
|
const dataStatus = {} |
||||
|
|
||||
|
function resetStatus(datas) { |
||||
|
datas.forEach(e => { |
||||
|
dataStatus[e.id] = { |
||||
|
delete: 0, |
||||
|
edit: 0 |
||||
|
} |
||||
|
if (e.children) { |
||||
|
resetStatus(e.children) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
resetStatus(crud.data) |
||||
|
crud.dataStatus = dataStatus |
||||
|
}, |
||||
|
/** |
||||
|
* 获取数据状态 |
||||
|
* @param {Number | String} id 数据项id |
||||
|
*/ |
||||
|
getDataStatus(id) { |
||||
|
return crud.dataStatus[id] |
||||
|
}, |
||||
|
/** |
||||
|
* 切换选中状态 |
||||
|
* @param selection |
||||
|
* @param data |
||||
|
*/ |
||||
|
toggleRowSelection(selection, data) { |
||||
|
if (data.children) { |
||||
|
data.children.forEach(val => { |
||||
|
crud.findVM('presenter').$refs['customTable'].$refs['table'].toggleRowSelection(val, false) |
||||
|
if (val.children) { |
||||
|
crud.toggleRowSelection(selection, val) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
findVM(type) { |
||||
|
return crud.vms.find(vm => vm && vm.type === type).vm |
||||
|
}, |
||||
|
notify(title, type = CRUD.NOTIFICATION_TYPE.INFO) { |
||||
|
crud.vms[0].vm.$notify({ |
||||
|
title, |
||||
|
type, |
||||
|
duration: 2500 |
||||
|
}) |
||||
|
}, |
||||
|
updateProp(name, value) { |
||||
|
Vue.set(crud.props, name, value) |
||||
|
} |
||||
|
} |
||||
|
const crud = Object.assign({}, data) |
||||
|
// 可观测化
|
||||
|
Vue.observable(crud) |
||||
|
// 附加方法
|
||||
|
Object.assign(crud, methods) |
||||
|
// 记录初始默认的查询参数,后续重置查询时使用
|
||||
|
Object.assign(crud, { |
||||
|
defaultQuery: JSON.parse(JSON.stringify(data.query)), |
||||
|
// 预留4位存储:组件 主页、头部、分页、表单,调试查看也方便找
|
||||
|
vms: Array(4), |
||||
|
/** |
||||
|
* 注册组件实例 |
||||
|
* @param {String} type 类型 |
||||
|
* @param {*} vm 组件实例 |
||||
|
* @param {Number} index 该参数内部使用 |
||||
|
*/ |
||||
|
registerVM(type, vm, index = -1) { |
||||
|
const vmObj = { |
||||
|
type, |
||||
|
vm: vm |
||||
|
} |
||||
|
if (index < 0) { |
||||
|
this.vms.push(vmObj) |
||||
|
return |
||||
|
} |
||||
|
this.vms.length = Math.max(this.vms.length, index) |
||||
|
this.vms.splice(index, 1, vmObj) |
||||
|
}, |
||||
|
/** |
||||
|
* 取消注册组件实例 |
||||
|
* @param {*} vm 组件实例 |
||||
|
*/ |
||||
|
unregisterVM(vm) { |
||||
|
this.vms.splice(this.vms.findIndex(e => e && e.vm === vm), 1) |
||||
|
} |
||||
|
}) |
||||
|
// 冻结处理,需要扩展数据的话,使用crud.updateProp(name, value),以crud.props.name形式访问,这个是响应式的,可以做数据绑定
|
||||
|
Object.freeze(crud) |
||||
|
return crud |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 合并选项参数 |
||||
|
*/ |
||||
|
function mergeOptions(src, options) { |
||||
|
const optionsRet = { |
||||
|
...src |
||||
|
} |
||||
|
for (const key in src) { |
||||
|
if (Object.prototype.hasOwnProperty.call(src, key)) { |
||||
|
if (Object.prototype.hasOwnProperty.call(options, key)) { |
||||
|
optionsRet[key] = options[key] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return optionsRet |
||||
|
} |
||||
|
|
||||
|
// hook VM
|
||||
|
function callVmHook(crud, hook) { |
||||
|
if (crud.debug) { |
||||
|
console.log('callVmHook: ' + hook) |
||||
|
} |
||||
|
let result = true |
||||
|
const args = [crud] |
||||
|
for (let i = 2; i < arguments.length; ++i) { |
||||
|
args.push(arguments[i]) |
||||
|
} |
||||
|
// 有些组件扮演了多个角色,调用钩子时,需要去重
|
||||
|
const vmSet = new Set() |
||||
|
crud.vms.forEach(vm => vm && vmSet.add(vm.vm)) |
||||
|
vmSet.forEach(vm => { |
||||
|
if (vm[hook]) { |
||||
|
result = vm[hook].apply(vm, args) !== false && result |
||||
|
} |
||||
|
}) |
||||
|
return result |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* crud主页 |
||||
|
*/ |
||||
|
function presenter(crud) { |
||||
|
function obColumns(columns) { |
||||
|
return { |
||||
|
visible(col) { |
||||
|
return !columns || !columns[col] ? true : columns[col].visible |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return { |
||||
|
inject: ['crud'], |
||||
|
beforeCreate() { |
||||
|
// 由于initInjections在initProvide之前执行,如果该组件自己就需要crud,需要在initInjections前准备好crud
|
||||
|
this._provided = { |
||||
|
crud, |
||||
|
'crud.query': crud.query, |
||||
|
'crud.page': crud.page, |
||||
|
'crud.form': crud.form |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
searchToggle: true, |
||||
|
columns: obColumns() |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.registerVM('presenter', this, 0) |
||||
|
if (crud.queryOnPresenterCreated) { |
||||
|
crud.resetQuery() |
||||
|
} |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
this.crud.unregisterVM(this) |
||||
|
// 清除选中的数组
|
||||
|
this.$refs.customTable.$refs['table'].clearSelection() |
||||
|
}, |
||||
|
mounted() { |
||||
|
const columns = {} |
||||
|
setTimeout(() => { |
||||
|
this.$refs.customTable.$refs.table.columns.forEach(e => { |
||||
|
if (!e.property || e.type !== 'default') { |
||||
|
return |
||||
|
} |
||||
|
columns[e.property] = { |
||||
|
label: e.label, |
||||
|
visible: true |
||||
|
} |
||||
|
}) |
||||
|
this.columns = obColumns(columns) |
||||
|
this.crud.updateProp('tableColumns', columns) |
||||
|
}, 1) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 头部 |
||||
|
*/ |
||||
|
function header() { |
||||
|
return { |
||||
|
inject: { |
||||
|
crud: { |
||||
|
from: 'crud' |
||||
|
}, |
||||
|
query: { |
||||
|
from: 'crud.query' |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.registerVM('header', this, 1) |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
this.crud.unregisterVM(this) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页 |
||||
|
*/ |
||||
|
function pagination() { |
||||
|
return { |
||||
|
inject: { |
||||
|
crud: { |
||||
|
from: 'crud' |
||||
|
}, |
||||
|
page: { |
||||
|
from: 'crud.page' |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.registerVM('pagination', this, 2) |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
this.crud.unregisterVM(this) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 表单 |
||||
|
*/ |
||||
|
function form(defaultForm) { |
||||
|
return { |
||||
|
inject: { |
||||
|
crud: { |
||||
|
from: 'crud' |
||||
|
}, |
||||
|
form: { |
||||
|
from: 'crud.form' |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.registerVM('form', this, 3) |
||||
|
this.crud.defaultForm = defaultForm |
||||
|
this.crud.resetForm() |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
this.crud.unregisterVM(this) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* crud |
||||
|
*/ |
||||
|
function crud(options = {}) { |
||||
|
const defaultOptions = { |
||||
|
type: undefined |
||||
|
} |
||||
|
options = mergeOptions(defaultOptions, options) |
||||
|
return { |
||||
|
inject: { |
||||
|
crud: { |
||||
|
from: 'crud' |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.registerVM(options.type, this) |
||||
|
}, |
||||
|
beforeDestroy() { |
||||
|
this.crud.unregisterVM(this) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* CRUD钩子 |
||||
|
*/ |
||||
|
CRUD.HOOK = { |
||||
|
/** 查询条件重置 -之后 */ |
||||
|
afterResetQuery: 'afterCrudResetQuery', |
||||
|
/** 刷新 - 之前 */ |
||||
|
beforeRefresh: 'beforeCrudRefresh', |
||||
|
/** 刷新 - 之后 */ |
||||
|
afterRefresh: 'afterCrudRefresh', |
||||
|
/** 删除 - 之前 */ |
||||
|
beforeDelete: 'beforeCrudDelete', |
||||
|
/** 删除 - 之后 */ |
||||
|
afterDelete: 'afterCrudDelete', |
||||
|
/** 删除取消 - 之前 */ |
||||
|
beforeDeleteCancel: 'beforeCrudDeleteCancel', |
||||
|
/** 删除取消 - 之后 */ |
||||
|
afterDeleteCancel: 'afterCrudDeleteCancel', |
||||
|
/** 新建 - 之前 */ |
||||
|
beforeToAdd: 'beforeCrudToAdd', |
||||
|
/** 新建 - 之后 */ |
||||
|
afterToAdd: 'afterCrudToAdd', |
||||
|
/** 编辑 - 之前 */ |
||||
|
beforeToEdit: 'beforeCrudToEdit', |
||||
|
/** 编辑 - 之后 */ |
||||
|
afterToEdit: 'afterCrudToEdit', |
||||
|
/** 开始 "新建/编辑" - 之前 */ |
||||
|
beforeToCU: 'beforeCrudToCU', |
||||
|
/** 开始 "新建/编辑" - 之后 */ |
||||
|
afterToCU: 'afterCrudToCU', |
||||
|
/** "新建/编辑" 验证 - 之前 */ |
||||
|
beforeValidateCU: 'beforeCrudValidateCU', |
||||
|
/** "新建/编辑" 验证 - 之后 */ |
||||
|
afterValidateCU: 'afterCrudValidateCU', |
||||
|
/** 添加取消 - 之前 */ |
||||
|
beforeAddCancel: 'beforeCrudAddCancel', |
||||
|
/** 添加取消 - 之后 */ |
||||
|
afterAddCancel: 'afterCrudAddCancel', |
||||
|
/** 编辑取消 - 之前 */ |
||||
|
beforeEditCancel: 'beforeCrudEditCancel', |
||||
|
/** 编辑取消 - 之后 */ |
||||
|
afterEditCancel: 'afterCrudEditCancel', |
||||
|
/** 行点击 - 之后 */ |
||||
|
afterRowClick: 'afterCrudRowClick', |
||||
|
/** 提交 - 之前 */ |
||||
|
beforeSubmit: 'beforeCrudSubmitCU', |
||||
|
/** 提交 - 之后 */ |
||||
|
afterSubmit: 'afterCrudSubmitCU', |
||||
|
afterAddError: 'afterCrudAddError', |
||||
|
afterEditError: 'afterCrudEditError' |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* CRUD状态 |
||||
|
*/ |
||||
|
CRUD.STATUS = { |
||||
|
NORMAL: 0, |
||||
|
PREPARED: 1, |
||||
|
PROCESSING: 2 |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* CRUD通知类型 |
||||
|
*/ |
||||
|
CRUD.NOTIFICATION_TYPE = { |
||||
|
SUCCESS: 'success', |
||||
|
WARNING: 'warning', |
||||
|
INFO: 'info', |
||||
|
ERROR: 'error' |
||||
|
} |
||||
|
|
||||
|
export default CRUD |
||||
|
|
||||
|
export { |
||||
|
presenter, |
||||
|
header, |
||||
|
form, |
||||
|
pagination, |
||||
|
crud |
||||
|
} |
@ -0,0 +1,167 @@ |
|||||
|
<template> |
||||
|
<div class="crud-opts"> |
||||
|
<span class="crud-opts-left"> |
||||
|
<!--左侧插槽--> |
||||
|
<slot name="left" /> |
||||
|
<el-button |
||||
|
v-if="crud.optionShow.add" |
||||
|
v-permission="permission.add" |
||||
|
class="filter-item" |
||||
|
type="primary" |
||||
|
icon="el-icon-plus" |
||||
|
@click="crud.toAdd" |
||||
|
> |
||||
|
新增 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
v-if="crud.optionShow.edit" |
||||
|
v-permission="permission.edit" |
||||
|
class="filter-item" |
||||
|
type="success" |
||||
|
icon="el-icon-edit" |
||||
|
:disabled="crud.selections.length !== 1" |
||||
|
@click="crud.toEdit(crud.selections[0])" |
||||
|
> |
||||
|
修改 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
v-if="crud.optionShow.del" |
||||
|
slot="reference" |
||||
|
v-permission="permission.del" |
||||
|
class="filter-item" |
||||
|
type="danger" |
||||
|
icon="el-icon-delete" |
||||
|
:disabled="crud.selections.length === 0" |
||||
|
@click="toDelete(crud.selections)" |
||||
|
> |
||||
|
删除 |
||||
|
</el-button> |
||||
|
<!--右侧--> |
||||
|
<slot name="right" /> |
||||
|
</span> |
||||
|
<el-button-group class="crud-opts-right"> |
||||
|
<el-button |
||||
|
plain |
||||
|
type="info" |
||||
|
icon="el-icon-search" |
||||
|
@click="toggleSearch()" |
||||
|
/> |
||||
|
<el-button |
||||
|
icon="el-icon-refresh" |
||||
|
@click="crud.refresh()" |
||||
|
/> |
||||
|
<el-popover |
||||
|
placement="bottom-end" |
||||
|
width="150" |
||||
|
trigger="click" |
||||
|
> |
||||
|
<el-button |
||||
|
slot="reference" |
||||
|
icon="el-icon-s-grid" |
||||
|
> |
||||
|
<i |
||||
|
class="fa fa-caret-down" |
||||
|
aria-hidden="true" |
||||
|
/> |
||||
|
</el-button> |
||||
|
<el-checkbox |
||||
|
v-model="allColumnsSelected" |
||||
|
:indeterminate="allColumnsSelectedIndeterminate" |
||||
|
@change="handleCheckAllChange" |
||||
|
> |
||||
|
全选 |
||||
|
</el-checkbox> |
||||
|
<el-checkbox |
||||
|
v-for="item in crud.props.tableColumns" |
||||
|
:key="item.label" |
||||
|
v-model="item.visible" |
||||
|
@change="handleCheckedTableColumnsChange(item)" |
||||
|
> |
||||
|
{{ item.label }} |
||||
|
</el-checkbox> |
||||
|
</el-popover> |
||||
|
</el-button-group> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import CRUD, { crud } from '@/components/Crud/crud' |
||||
|
export default { |
||||
|
mixins: [crud()], |
||||
|
props: { |
||||
|
permission: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
allColumnsSelected: true, |
||||
|
allColumnsSelectedIndeterminate: false |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.updateProp('searchToggle', true) |
||||
|
}, |
||||
|
methods: { |
||||
|
toDelete(datas) { |
||||
|
this.$confirm(`确认删除选中的 ${datas.length} 条数据?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.crud.doDelete(datas) |
||||
|
}) |
||||
|
}, |
||||
|
handleCheckAllChange(val) { |
||||
|
if (val === false) { |
||||
|
this.allColumnsSelected = true |
||||
|
return |
||||
|
} |
||||
|
for (const key in this.crud.props.tableColumns) { |
||||
|
if (Object.prototype.hasOwnProperty.call(this.crud.props.tableColumns, key)) { |
||||
|
this.crud.props.tableColumns[key].visible = val |
||||
|
} |
||||
|
} |
||||
|
this.allColumnsSelected = val |
||||
|
this.allColumnsSelectedIndeterminate = false |
||||
|
}, |
||||
|
handleCheckedTableColumnsChange(item) { |
||||
|
let totalCount = 0 |
||||
|
let selectedCount = 0 |
||||
|
for (const key in this.crud.props.tableColumns) { |
||||
|
++totalCount |
||||
|
if (Object.prototype.hasOwnProperty.call(this.crud.props.tableColumns, key)) { |
||||
|
selectedCount += this.crud.props.tableColumns[key].visible ? 1 : 0 |
||||
|
} |
||||
|
} |
||||
|
if (selectedCount === 0) { |
||||
|
this.crud.notify('请至少选择一列', CRUD.NOTIFICATION_TYPE.WARNING) |
||||
|
this.$nextTick(function() { |
||||
|
item.visible = true |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
this.allColumnsSelected = selectedCount === totalCount |
||||
|
this.allColumnsSelectedIndeterminate = selectedCount !== totalCount && selectedCount !== 0 |
||||
|
}, |
||||
|
toggleSearch() { |
||||
|
this.crud.props.searchToggle = !this.crud.props.searchToggle |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.crud-opts { |
||||
|
padding: 6px 0; |
||||
|
display: -webkit-flex; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.crud-opts-left{ |
||||
|
display: flex; |
||||
|
} |
||||
|
.crud-opts .crud-opts-right { |
||||
|
margin-left: auto; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,169 @@ |
|||||
|
<template> |
||||
|
<el-select :value="valueTitle" :placeholder="placeholderSelect" :clearable="clearable" @clear="clearHandle"> |
||||
|
<el-input |
||||
|
v-model="filterText" |
||||
|
class="selectInput" |
||||
|
:placeholder="placeholder" |
||||
|
clearable |
||||
|
/> |
||||
|
<el-option :value="valueTitle" :label="valueTitle" class="options"> |
||||
|
<el-tree |
||||
|
id="tree-option" |
||||
|
ref="selectTree" |
||||
|
:accordion="accordion" |
||||
|
:data="options" |
||||
|
:props="props" |
||||
|
:node-key="props.value" |
||||
|
:expand-on-click-node="false" |
||||
|
:default-expanded-keys="defaultExpandedKey" |
||||
|
:filter-node-method="filterNode" |
||||
|
@node-click="handleNodeClick" |
||||
|
/> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'ElTreeSelect', |
||||
|
props: { |
||||
|
/* 配置项 */ |
||||
|
props: { |
||||
|
type: Object, |
||||
|
default: () => { |
||||
|
return { |
||||
|
value: 'id', // ID字段名 |
||||
|
label: 'title', // 显示名称 |
||||
|
children: 'children' // 子级字段名 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
/* 选项列表数据(树形结构的对象数组) */ |
||||
|
options: { |
||||
|
type: Array, |
||||
|
default: () => { return [] } |
||||
|
}, |
||||
|
/* 初始值 */ |
||||
|
value: { |
||||
|
type: Number, |
||||
|
default: () => { return null } |
||||
|
}, |
||||
|
/* 可清空选项 */ |
||||
|
clearable: { |
||||
|
type: Boolean, |
||||
|
default: () => { return true } |
||||
|
}, |
||||
|
/* 自动收起 */ |
||||
|
accordion: { |
||||
|
type: Boolean, |
||||
|
default: () => { return false } |
||||
|
}, |
||||
|
placeholder: { |
||||
|
type: String, |
||||
|
default: () => { return '检索关键字' } |
||||
|
}, |
||||
|
placeholderSelect: { |
||||
|
type: String, |
||||
|
default: () => { return '请选择' } |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
filterText: '', |
||||
|
valueId: this.value, // 初始值 |
||||
|
valueTitle: '', |
||||
|
defaultExpandedKey: [] |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
value() { |
||||
|
this.valueId = this.value |
||||
|
this.initHandle() |
||||
|
}, |
||||
|
filterText(val) { |
||||
|
this.$refs.selectTree.filter(val) |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.initHandle() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 初始化值 |
||||
|
initHandle() { |
||||
|
if (this.valueId) { |
||||
|
this.valueTitle = this.$refs.selectTree.getNode(this.valueId).data[this.props.label] // 初始化显示 |
||||
|
this.$refs.selectTree.setCurrentKey(this.valueId) // 设置默认选中 |
||||
|
this.defaultExpandedKey = [this.valueId] // 设置默认展开 |
||||
|
} |
||||
|
this.initScroll() |
||||
|
}, |
||||
|
// 初始化滚动条 |
||||
|
initScroll() { |
||||
|
this.$nextTick(() => { |
||||
|
const scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0] |
||||
|
const scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar') |
||||
|
scrollWrap.style.cssText = 'margin: 0px; max-height: none; overflow: hidden;' |
||||
|
scrollBar.forEach(ele => { ele.style.width = 0 }) |
||||
|
}) |
||||
|
}, |
||||
|
// 切换选项 |
||||
|
handleNodeClick(node) { |
||||
|
this.valueTitle = node[this.props.label] |
||||
|
this.valueId = node[this.props.value] |
||||
|
this.$emit('getValue', this.valueId) |
||||
|
this.defaultExpandedKey = [] |
||||
|
}, |
||||
|
// 清除选中 |
||||
|
clearHandle() { |
||||
|
this.valueTitle = '' |
||||
|
this.filterText = '' |
||||
|
this.valueId = null |
||||
|
this.defaultExpandedKey = [] |
||||
|
this.clearSelected() |
||||
|
this.$emit('getValue', 0) |
||||
|
}, |
||||
|
/* 清空选中样式 */ |
||||
|
clearSelected() { |
||||
|
const allNode = document.querySelectorAll('#tree-option .el-tree-node') |
||||
|
allNode.forEach((element) => element.classList.remove('is-current')) |
||||
|
}, |
||||
|
filterNode(value, data) { |
||||
|
if (!value) return true |
||||
|
return data.departmentName.indexOf(value) !== -1 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
||||
|
<style scoped> |
||||
|
.el-scrollbar .el-scrollbar__view .el-select-dropdown__item{ |
||||
|
height: auto; |
||||
|
max-height: 274px; |
||||
|
padding: 0; |
||||
|
overflow: hidden; |
||||
|
overflow-y: auto; |
||||
|
} |
||||
|
.el-select-dropdown__item.selected{ |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
ul li >>>.el-tree .el-tree-node__content{ |
||||
|
height:auto; |
||||
|
padding: 0 20px; |
||||
|
} |
||||
|
.el-tree-node__label{ |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
.el-tree >>>.is-current .el-tree-node__label{ |
||||
|
color: #409EFF; |
||||
|
font-weight: 700; |
||||
|
} |
||||
|
.el-tree >>>.is-current .el-tree-node__children .el-tree-node__label{ |
||||
|
color:#606266; |
||||
|
font-weight: normal; |
||||
|
} |
||||
|
.selectInput{ |
||||
|
padding: 0 5px; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,124 @@ |
|||||
|
<template> |
||||
|
<el-table |
||||
|
ref="table" |
||||
|
v-adaptive="{ bottomOffset: 45 }" |
||||
|
height="100px" |
||||
|
:data="data" |
||||
|
:row-class-name="rowClassName" |
||||
|
border |
||||
|
fit |
||||
|
highlight-current-row |
||||
|
stripe |
||||
|
:row-key="rowKey" |
||||
|
:default-expand-all="expandAll" |
||||
|
:tree-props="treeProps" |
||||
|
@row-click="crud.rowClickHandler" |
||||
|
@selection-change="crud.selectionChangeHandler" |
||||
|
> |
||||
|
<!-- 列表公共列 --> |
||||
|
<el-table-column type="selection" width="40" /> |
||||
|
<el-table-column align="center" type="index" label="序号" width="80" /> |
||||
|
<template v-for="colConfig in colConfigs"> |
||||
|
<!-- 操作按钮插槽 --> |
||||
|
<slot v-if="colConfig.slot" :name="colConfig.slot" /> |
||||
|
<!-- 无自定义内容列 --> |
||||
|
<el-table-column |
||||
|
:key="colConfig.prop" |
||||
|
:prop="colConfig.prop" |
||||
|
:align="colConfig.align" |
||||
|
:sortable="colConfig.sortable" |
||||
|
:label="colConfig.label" |
||||
|
:min-width="colConfig.width" |
||||
|
:formatter="colConfig.formatter" |
||||
|
:show-overflow-tooltip="colConfig.showOverflowTooltip" |
||||
|
/> |
||||
|
<!-- 有自定义内容列 --> |
||||
|
<el-table-column |
||||
|
:key="colConfig.prop" |
||||
|
:prop="colConfig.prop" |
||||
|
:align="colConfig.align" |
||||
|
:sortable="colConfig.sortable" |
||||
|
:min-width="colConfig.width" |
||||
|
:label="colConfig.label" |
||||
|
:show-overflow-tooltip="colConfig.showOverflowTooltip" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
v-permission="permission.edit" |
||||
|
type="text" |
||||
|
:disabled="disabledEdit" |
||||
|
icon="edit" |
||||
|
@click="crud.toEdit(data)" |
||||
|
> |
||||
|
修改 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
slot="reference" |
||||
|
:disabled="disabledDel" |
||||
|
type="text" |
||||
|
@click="toDelete" |
||||
|
> |
||||
|
删除 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</template> |
||||
|
</el-table> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import adaptive from '@/directive/el-table' |
||||
|
export default { |
||||
|
directives: { adaptive }, |
||||
|
props: { |
||||
|
colConfigs: { |
||||
|
required: true, |
||||
|
type: Array |
||||
|
}, |
||||
|
data: { |
||||
|
required: true, |
||||
|
type: Array |
||||
|
}, |
||||
|
columns: { |
||||
|
required: true, |
||||
|
type: Object |
||||
|
}, |
||||
|
width: { |
||||
|
type: Number, |
||||
|
default: 0 |
||||
|
}, |
||||
|
expandAll: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
treeProps: { |
||||
|
type: Object, |
||||
|
default: function() { |
||||
|
return { children: 'children', hasChildren: 'hasChildren' } |
||||
|
} |
||||
|
}, |
||||
|
rowKey: { |
||||
|
type: String, |
||||
|
default: 'id' |
||||
|
}, |
||||
|
selection: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
rowClassName: { |
||||
|
type: Function, |
||||
|
default: () => { |
||||
|
return '' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
.el-table .table-row-color-red { |
||||
|
color: red; |
||||
|
} |
||||
|
.el-table .table-row-color-orange { |
||||
|
color: #ff8c00; |
||||
|
} |
||||
|
</style> |
@ -1,306 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="primary" icon="el-icon-sold-out" @click="renwuFp"> |
|
||||
批量分配 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.serialNumber" placeholder="流水号" clearable style="width: 160px" /> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 400px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-loading="showLoading" |
|
||||
element-loading-text="正在加载" |
|
||||
element-loading-spinner="el-icon-loading" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
height="650px" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column align="center" label="序号" width="60" fixed="left"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="流水号" prop="serialNumber" width="140" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" width="100" /> |
|
||||
<el-table-column align="center" label="检验类别" prop="jianyanleibie" width="100" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" width="180" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" /> |
|
||||
<el-table-column align="center" label="联系人" prop="shiyongdanweiLianxiren" width="140" /> |
|
||||
<el-table-column align="center" label="联系电话" prop="shiyongdanweiDianhua" width="140" /> |
|
||||
<el-table-column align="center" label="区划名称" prop="quhuamingcheng" width="140" /> |
|
||||
<!--<el-table-column align="center" label="交费状态" prop="jfState" min-width="40">--> |
|
||||
<!--<template slot-scope="scope">--> |
|
||||
<!--<el-tag type="success" v-if="scope.row.jfstate===true">已交费</el-tag>--> |
|
||||
<!--<el-tag type="primary" v-else>未交费</el-tag>--> |
|
||||
<!--</template>--> |
|
||||
<!--</el-table-column>--> |
|
||||
<el-table-column fixed="right" align="center" label="报检日期" prop="shouliriqi" width="100" /> |
|
||||
<el-table-column fixed="right" align="center" label="备注" prop="beizhu" width="80" /> |
|
||||
<el-table-column fixed="right" align="center" label="操作(已/总)" width="140"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button style="margin-left:1px" size="medium" round> |
|
||||
<span style="color: #67C23A;font-weight: bold">{{ scope.row.allotNum }}</span> / <span style="color: #F56C6C;font-weight: bold">{{ scope.row.totalNum }}</span> |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<el-pagination |
|
||||
:current-page="listQuery.pageNum" |
|
||||
:page-size="listQuery.pageRow" |
|
||||
:total="totalCount" |
|
||||
:page-sizes="[10, 20, 40, 100]" |
|
||||
background |
|
||||
layout="total, sizes, prev, pager, next, jumper" |
|
||||
@size-change="handleSizeChange" |
|
||||
@current-change="handleCurrentChange" |
|
||||
/> |
|
||||
<el-dialog :visible.sync="dialogVisible" title="任务分配" width="1500px" @close="closeDialog"> |
|
||||
<el-container> |
|
||||
<el-header> |
|
||||
<el-select v-model="departmentId" placeholder="请选择科室" style="width: 240px;" @change="selectDepUser"> |
|
||||
<el-option v-for="dept in depts" :key="dept.id" :label="dept.name" :value="dept.id" /> |
|
||||
</el-select> |
|
||||
<el-select v-model="renlingren" :collapse-tags="true" placeholder="请选择人员" multiple style="width: 240px;"> |
|
||||
<el-option v-for="user in users" :key="user.id" :label="user.nickname" :value="user.id" /> |
|
||||
</el-select> |
|
||||
<el-button type="primary" @disabled="btnClick" @click="allotRenwu"> |
|
||||
执行分配 |
|
||||
</el-button> |
|
||||
</el-header> |
|
||||
</el-container> |
|
||||
<el-table ref="allotList" :data="allotList" size="small" style="width: 150%" border fit highlight-current-row @row-click="onDialogRowClick" @selection-change="handleDialogSelectionChange"> |
|
||||
<el-table-column type="selection" width="45" /> |
|
||||
<el-table-column align="center" label="序号" width="50" fixed="left"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="检验类别" prop="jianyanleibie" width="100px;" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240px;" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" width="180px;" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="220px;" /> |
|
||||
<el-table-column align="center" label="使用登记编号" prop="shiyongdengjibianhao" width="220px;" /> |
|
||||
<el-table-column align="center" label="报检日期" prop="shouliriqi" width="100px;" /> |
|
||||
<el-table-column align="center" label="下次检验日期" prop="xiacijianyanriqi" width="100px;" /> |
|
||||
<el-table-column v-if="allotSbzl === '8000'" align="center" label="管道长度(m)/数量(条)" prop="guandaochangdu" width="100px;" /> |
|
||||
</el-table> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Utils from '@/utils/contact' |
|
||||
export default { |
|
||||
name: 'AllotOldList', |
|
||||
components: { Sticky }, |
|
||||
data() { |
|
||||
return { |
|
||||
dialogVisible: false, |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
sbzlList: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
shiyongdanwei: undefined, |
|
||||
shebeizhongleidaima: '', |
|
||||
order: 'modifyDate desc' |
|
||||
}, |
|
||||
multipleSelection: [], |
|
||||
allotList: [], |
|
||||
depts: [], |
|
||||
users: [], |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
renlingren: [], |
|
||||
selection: [], |
|
||||
btnClick: false, |
|
||||
showLoading: true, |
|
||||
allotSbzl: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getDepartment() |
|
||||
this.getSbzlList() |
|
||||
this.getUserList(this.departmentId) |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('allot-old-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.showLoading = true |
|
||||
this.apibjd({ |
|
||||
url: '/renwu/listold', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
this.showLoading = false |
|
||||
}) |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
handleSizeChange(val) { |
|
||||
// 改变每页数量 |
|
||||
this.listQuery.pageRow = val |
|
||||
this.handleFilter() |
|
||||
}, |
|
||||
handleCurrentChange(val) { |
|
||||
// 改变页码 |
|
||||
this.listQuery.pageNum = val |
|
||||
this.getList() |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
// 批量分配 |
|
||||
renwuFp() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ message: '请在列表选择要操作的数据。', type: 'warning' }) |
|
||||
return false |
|
||||
} |
|
||||
let bjdIds = '' |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
if (i === 0) { |
|
||||
bjdIds = this.multipleSelection[i].bjdId |
|
||||
} else { |
|
||||
bjdIds = bjdIds + ',' + this.multipleSelection[i].bjdId |
|
||||
} |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/renwu/getAllotBaseListOld', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
bjdIds: bjdIds |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.allotList = data.list |
|
||||
this.allotSbzl = this.multipleSelection[0].shebeizhongleidaima |
|
||||
this.dialogVisible = true |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.allotList.toggleAllSelection() |
|
||||
this.selection = data.list |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
// 表格单击选中行 |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 获取选中行的bjdId |
|
||||
handleSelectionChange(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
onDialogRowClick(row) { |
|
||||
this.$refs.allotList.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleDialogSelectionChange(val) { |
|
||||
this.selection = val |
|
||||
}, |
|
||||
// 查询检验科室 |
|
||||
getDepartment() { |
|
||||
this.api({ |
|
||||
url: '/department/getAllDepartment', |
|
||||
method: 'get' |
|
||||
}).then(data => { |
|
||||
this.depts = data |
|
||||
}) |
|
||||
}, |
|
||||
selectDepUser(val) { |
|
||||
this.renlingren = [] |
|
||||
this.getUserList(val) |
|
||||
}, |
|
||||
getUserList(val) { |
|
||||
this.api({ |
|
||||
url: '/user/getUserListByDepartmentId', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
departmentId: val |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.users = data |
|
||||
}) |
|
||||
}, |
|
||||
closeDialog() { |
|
||||
this.renlingren = [] |
|
||||
this.departmentId = this.$store.getters.departmentId |
|
||||
this.users = this.getUserList(this.departmentId) |
|
||||
}, |
|
||||
allotRenwu() { |
|
||||
this.btnClick = true |
|
||||
if (this.selection.length === 0) { |
|
||||
this.$message({ message: '请选择要分配的数据。', type: 'warning' }) |
|
||||
return false |
|
||||
} |
|
||||
if (this.renlingren.length > 0) { |
|
||||
this.apibjd({ |
|
||||
url: '/renwu/completeAllotOld', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
renwuList: this.selection, |
|
||||
renlingren: this.renlingren |
|
||||
} |
|
||||
}).then(() => { |
|
||||
this.multipleSelection = [] |
|
||||
// 刷新分配任务列表 |
|
||||
this.getList() |
|
||||
// 刷新我的任务列表 |
|
||||
Utils.$emit('task-list') |
|
||||
this.$message({ message: '分配成功。', type: 'success' }) |
|
||||
this.dialogVisible = false |
|
||||
this.showLoading = true |
|
||||
}) |
|
||||
} else { |
|
||||
this.$message({ message: '请选择要分配的人员。', type: 'warning' }) |
|
||||
return false |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,150 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchRw.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 340px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchRw.zhucedaima" placeholder="注册代码" clearable style="width: 230px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchRw.shiyongdengjibianhao" placeholder="使用登记证号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空条件 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column align="center" label="序号" width="60" fixed="left"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报检单号" prop="serialNumber" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" /> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" /> |
|
||||
<el-table-column align="center" label="区划名称" prop="quhuamingcheng" /> |
|
||||
<el-table-column align="center" label="下次检验日期" prop="xiacijianyanriqi" width="120" /> |
|
||||
<el-table-column align="center" label="操作" prop="access" width="110" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button size="mini" type="info" icon="el-icon-message" title="查看退回原因" circle @click="viewBohui(scope.row.id)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<!-- 驳回操作 --> |
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="驳回意见" width="50%"> |
|
||||
<el-table :data="infoNotes"> |
|
||||
<el-table-column align="center" type="index" label="序号" width="50" /> |
|
||||
<el-table-column align="center" prop="flowName" label="当前环节" width="120" /> |
|
||||
<el-table-column align="center" prop="infoSend" label="环节操作人" width="120" /> |
|
||||
<el-table-column align="center" prop="infoActor" label="环节处理人" width="180" /> |
|
||||
<el-table-column prop="infoNotes" label="执行操作" width="240" /> |
|
||||
<el-table-column align="center" prop="createTime" label="操作时间" width="200" /> |
|
||||
</el-table> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
export default { |
|
||||
name: 'ZuofeiList', |
|
||||
components: { Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
sbzlList: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
searchRw: {} |
|
||||
}, |
|
||||
multipleSelection: [], |
|
||||
selection: {}, |
|
||||
dialogFormVisible: false, |
|
||||
neibuleibie: '', |
|
||||
infoNotes: [], |
|
||||
dialogEnclosureVisible: false |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
}, |
|
||||
mounted() { |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.apibjd({ |
|
||||
url: '/renwu/getZuofeiList', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
this.showLoading = false |
|
||||
}) |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.selection = row |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
viewBohui(id) { // 任务撤回 |
|
||||
this.api({ |
|
||||
url: '/taskinfo/list', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
renwuId: id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (data !== '') { |
|
||||
this.dialogFormVisible = true |
|
||||
this.infoNotes = data |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchRw', {}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
formatterSlrq(row) { |
|
||||
if (row.shouliriqi) { |
|
||||
return row.shouliriqi.substring(0, 10) |
|
||||
} |
|
||||
return row.shouliriqi |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,150 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" clearable style="width: 150px"> |
|
||||
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.zhucedaima" placeholder="注册代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.shiyongdengjibianhao" placeholder="使用登记证编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.danweineibubianhao" placeholder="单位内部编号" clearable style="width: 150px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button-group> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-upload |
|
||||
:show-file-list="false" |
|
||||
:before-upload="beforeUpload" |
|
||||
:on-success="uploadSuccess" |
|
||||
style="float:left" |
|
||||
action="SBDemo/upload/uploadBaseInfo" |
|
||||
> |
|
||||
<el-button type="primary" icon="el-icon-upload"> |
|
||||
导入数据 |
|
||||
</el-button> |
|
||||
</el-upload> |
|
||||
</el-button-group> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
> |
|
||||
<el-table-column align="center" label="序号" width="55"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" min-width="50" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" min-width="150" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" min-width="100" /> |
|
||||
<el-table-column :formatter="clearBlank" align="center" label="使用登记证编号" prop="shiyongdengjibianhao" min-width="90" /> |
|
||||
<el-table-column align="center" label="出厂编号" prop="chanpinbianhao" min-width="80" /> |
|
||||
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" min-width="80" /> |
|
||||
<el-table-column :formatter="clearBlank" align="center" label="下次检验日期" prop="xiacijianyanriqi" min-width="70" /> |
|
||||
<el-table-column :formatter="clearBlank" align="center" label="区划名称" prop="quhuamingcheng" min-width="50" /> |
|
||||
<el-table-column v-if="hasPerm('user:update')" align="center" label="操作" style="width: 100px;"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" icon="edit" @click="showUpdate(scope.$index)"> |
|
||||
编辑 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
export default { |
|
||||
name: 'BaseList', |
|
||||
components: { Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
sbzlList: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
shiyongdanwei: undefined, |
|
||||
zhucedaima: undefined, |
|
||||
shiyongdengjibianhao: undefined |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('base-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
// 查询列表 |
|
||||
this.api({ |
|
||||
url: '/baseinfo/list', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
}) |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
clearBlank(row, column, cellValue) { |
|
||||
if (cellValue !== null && cellValue !== '') { |
|
||||
return cellValue |
|
||||
} |
|
||||
return '/' |
|
||||
}, |
|
||||
beforeUpload(file) { |
|
||||
const isExcel = file.type === 'application/vnd.ms-excel' || file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
||||
if (!isExcel) { |
|
||||
this.$message.error('只能上传xls/xlsx格式的文件') |
|
||||
return false |
|
||||
} |
|
||||
}, |
|
||||
uploadSuccess(response) { |
|
||||
if (response.returnCode === '100') { |
|
||||
this.$message.success('导入成功') |
|
||||
this.getList() |
|
||||
} else { |
|
||||
this.$message.error(response.returnMsg) |
|
||||
return false |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,525 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="success" icon="el-icon-printer" @click="batchPrintHzd"> |
|
||||
打印回执单 |
|
||||
</el-button> |
|
||||
<el-button type="warning" icon="el-icon-circle-close" @click="errorBjd"> |
|
||||
异常收回 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-circle-close" @click="invalidBjd"> |
|
||||
作废 |
|
||||
</el-button> |
|
||||
<el-button type="info" icon="el-icon-delete" @click="delBjd"> |
|
||||
删除 |
|
||||
</el-button> |
|
||||
<el-button type="warning" icon="el-icon-delete" @click="beforeMergeBjd"> |
|
||||
合并 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.serialNumber" placeholder="报检单号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.linshibianhao" placeholder="企业回执号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-date-picker v-model="listQuery.shouliriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择报检日期" style="width: 180px" /> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<br> |
|
||||
<span class="radio-group-label">报检状态:</span> |
|
||||
<el-radio-group v-model="listQuery.bjState" @change="handleFilter"> |
|
||||
<el-radio :label="undefined"> |
|
||||
全部 |
|
||||
</el-radio> |
|
||||
<el-radio :label="0"> |
|
||||
新建/预审 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
待审核 |
|
||||
</el-radio> |
|
||||
<el-radio :label="2"> |
|
||||
已审核 |
|
||||
</el-radio> |
|
||||
<el-radio :label="3"> |
|
||||
不予受理 |
|
||||
</el-radio> |
|
||||
<el-radio :label="4"> |
|
||||
补证通知 |
|
||||
</el-radio> |
|
||||
<el-radio :label="5"> |
|
||||
异常收回 |
|
||||
</el-radio> |
|
||||
<el-radio :label="6"> |
|
||||
异常退回 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="bjdList" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
element-loading-text="拼命加载中" |
|
||||
size="small" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="45" /> |
|
||||
<el-table-column align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报检单号/流水号" prop="serialNumber" min-width="80" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" min-width="50" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" min-width="150" /> |
|
||||
<el-table-column align="center" label="报检日期" prop="createTime" min-width="60" /> |
|
||||
<el-table-column align="center" label="报检状态" prop="bjState" min-width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.bjState===0" type="success"> |
|
||||
新建/预审 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===1" type="primary"> |
|
||||
待审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===2" type="info"> |
|
||||
已审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===3" type="warning"> |
|
||||
不予受理 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===4" type="warning"> |
|
||||
补正通知 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===5" type="danger"> |
|
||||
异常收回 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===6" type="danger"> |
|
||||
异常退回 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="设备台数" prop="totalNum" min-width="50" /> |
|
||||
<el-table-column align="center" label="受理人员" prop="shouliren" min-width="50" /> |
|
||||
<el-table-column align="center" label="操作" min-width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" size="small" circle icon="el-icon-edit" title="编辑" @click="editBjd(scope.$index)" /> |
|
||||
<el-button v-show="scope.row.bjState === '2' || scope.row.bjState === '5' || scope.row.bjState === '6'" type="success" size="small" circle icon="el-icon-view" title="预览回执单" @click="viewHzd(scope.row.id)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" @pagination="getList" /> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
<el-dialog title="合并" :visible.sync="dialogMergeVisible" width="1000px"> |
|
||||
<span>使用单位:</span> |
|
||||
<el-radio-group v-model="mergeSydw"> |
|
||||
<el-radio v-for="(item, index) in mergeSydws" :key="index" :label="item" border> |
|
||||
{{ item }} |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
<span slot="footer" class="dialog-footer"> |
|
||||
<el-button @click="dialogMergeVisible = false">取 消</el-button> |
|
||||
<el-button type="primary" @click="mergeBjd">确 定</el-button> |
|
||||
</span> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
// import store from '../../store' |
|
||||
// import router from '../../router' |
|
||||
export default { |
|
||||
name: 'ProjectWxList', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageSize: 20, // 每页条数 |
|
||||
orderBy: 'id desc', |
|
||||
zfState: false, |
|
||||
jianyanleibie: 'DJ', |
|
||||
shoulikeshi: undefined, |
|
||||
shouliren: undefined, |
|
||||
bjState: undefined, |
|
||||
dataSource: 2 |
|
||||
}, |
|
||||
sbzlList: [], |
|
||||
ids: '', |
|
||||
multipleSelection: [], |
|
||||
params: { |
|
||||
bjdIds: this.ids |
|
||||
}, |
|
||||
printbutton: '', |
|
||||
dialogMergeVisible: false, // 合并报检数据窗口 |
|
||||
mergeSydws: [], |
|
||||
mergeSydw: '', |
|
||||
mergeIds: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bjd-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/list', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.total |
|
||||
}) |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageSize + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
// this.listQuery.pageNum = 1 // 停留在当前页面不进行第一页跳转刷新。 |
|
||||
this.getList() |
|
||||
}, |
|
||||
handleCommand(item) { |
|
||||
this.$router.push({ path: '/bjd/bjd-dj-input/null/' + item.value + '/' + item.label + '/newBuild' }) |
|
||||
}, |
|
||||
// 表格单击选中行 |
|
||||
onRowClick(row) { |
|
||||
this.$refs.bjdList.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 获取选中行的bdjId |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
handleDialogSelectionChange(val) { |
|
||||
this.selection = val |
|
||||
}, |
|
||||
// 作废报检单 |
|
||||
invalidBjd: function() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要删除的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
this.$confirm('共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToZf', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection.map(rw => { |
|
||||
return rw.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.$message({ |
|
||||
message: (data.bianhao !== null && data.bianhao !== undefined ? '流水号为' + data.bianhao + '的项目关联的任务已经分配不能作废!' : '') + (data.count === 0 ? '' : data.count + '条项目作废成功'), |
|
||||
type: 'info' |
|
||||
}) |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消作废' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
// 删除报检单---只有未审核的报检单才能删除 |
|
||||
delBjd: function() { |
|
||||
this.ids = '' |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要删除的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
if (this.multipleSelection[i].bjState === '2') { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '选择的数据中有办结的项目,请重新选择!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
} |
|
||||
this.$confirm('共' + this.multipleSelection.length + '条报检项目将删除,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/delBjd', |
|
||||
method: 'delete', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection.map(rw => { |
|
||||
return rw.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.$message({ |
|
||||
message: data + '条项目删除成功', |
|
||||
type: 'success' |
|
||||
}) |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消删除' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 准备合并报检单 |
|
||||
*/ |
|
||||
beforeMergeBjd() { |
|
||||
// 0. 初始化 |
|
||||
this.mergeSydws = [] |
|
||||
this.mergeSydw = '' |
|
||||
this.mergeIds = '' |
|
||||
const selection = this.$refs.bjdList.selection |
|
||||
// 1. 判断是否选中超过2条的报检数据 |
|
||||
if (selection.length < 2) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要合并的数据!' |
|
||||
}) |
|
||||
return |
|
||||
} |
|
||||
// 2. 以报检申请人电话作为依据,判断是否可以进行合并 |
|
||||
// 申请人电话 |
|
||||
const sqrdh = selection[0].baojiandianhua ? selection[0].baojiandianhua : selection[0].shiyongdanweiDianhua |
|
||||
// 使用单位 |
|
||||
const sydw = [selection[0].shiyongdanwei] |
|
||||
this.mergeIds += selection[0].id |
|
||||
for (let i = 1; i < selection.length; i++) { |
|
||||
const tempSqrdh = selection[i].baojiandianhua ? selection[i].baojiandianhua : selection[i].shiyongdanweiDianhua |
|
||||
if (tempSqrdh !== sqrdh) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '报检申请人电话不一致,无法进行合并!' |
|
||||
}) |
|
||||
return |
|
||||
} |
|
||||
sydw.push(selection[i].shiyongdanwei) |
|
||||
this.mergeIds += (',' + selection[i].id) |
|
||||
} |
|
||||
// 3. 显示合并报检数据窗口,合并使用单位或者直接合并报检数据 |
|
||||
this.mergeSydws = [...new Set(sydw)] |
|
||||
if (this.mergeSydws.length > 1) { |
|
||||
this.dialogMergeVisible = true |
|
||||
} else { |
|
||||
// 3. 直接合并 |
|
||||
this.mergeSydw = this.mergeSydws[0] |
|
||||
this.mergeBjd() |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 合并报检单 |
|
||||
*/ |
|
||||
mergeBjd() { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/mergeBjd', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ids: this.mergeIds, |
|
||||
sydw: this.mergeSydw |
|
||||
} |
|
||||
}).then(() => { |
|
||||
this.dialogMergeVisible = false |
|
||||
this.$message.success('合并成功!') |
|
||||
this.getList() |
|
||||
}) |
|
||||
}, |
|
||||
editBjd($index) { |
|
||||
const bjd = this.list[$index] |
|
||||
let type = '/update' |
|
||||
if (bjd.bjState === '2') { |
|
||||
type = '/finish' |
|
||||
} |
|
||||
this.$router.push({ path: '/bjd/bjd-dj-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/' + bjd.shebeizhonglei + type }) |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
batchPrintHzd() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzdBatch', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListingBatch', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
list: data, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (data === 'success') { |
|
||||
this.preview({ |
|
||||
url: '/print/createXmlOther', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(','), |
|
||||
type: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
}) |
|
||||
} else { |
|
||||
this.$message({ message: '未能成功调用打印程序!', type: 'error' }) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
printHzd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ message: '只能打印一份报检单', type: 'error' }) |
|
||||
return |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzd', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.bjd, |
|
||||
paramList: data.renwu, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
viewHzd(bjdid) { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzd', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: bjdid |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.bjd, |
|
||||
paramList: data.renwu, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
errorBjd() { |
|
||||
// 异常收回 |
|
||||
this.$confirm('报检项目将进行异常收回,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message({ message: '只允许单台报检单收回', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].bjState !== '2') { |
|
||||
this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
// 业务 |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToYcsh', |
|
||||
method: 'get', |
|
||||
params: { bjdId: this.multipleSelection[0].id } |
|
||||
}).then(data => { |
|
||||
if (data.success === 'ok') { |
|
||||
this.$message({ |
|
||||
message: '异常收回成功!!请修改后重新审核通过!', |
|
||||
type: 'success' |
|
||||
}) |
|
||||
this.getList() |
|
||||
} else { |
|
||||
this.$message({ |
|
||||
message: '异常收回失败,存在已分配数据,请联系科室“异常退回”!', |
|
||||
type: 'warning' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消收回' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,362 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-dropdown v-show="hasPerm('manufactInspection:add')"> |
|
||||
<el-button type="primary"> |
|
||||
起草项目<i class="el-icon-arrow-down el-icon--right" /> |
|
||||
</el-button> |
|
||||
<el-dropdown-menu slot="dropdown"> |
|
||||
<router-link :to="'/bjd/bjd-zj-input/null/1000/newBuild'"> |
|
||||
<el-dropdown-item>锅炉</el-dropdown-item> |
|
||||
</router-link> |
|
||||
<router-link :to="'/bjd/bjd-zj-input/null/2000/newBuild'"> |
|
||||
<el-dropdown-item>压力容器</el-dropdown-item> |
|
||||
</router-link> |
|
||||
<router-link :to="'/bjd/bjd-zj-input/null/7000/newBuild'"> |
|
||||
<el-dropdown-item>压力管道元件</el-dropdown-item> |
|
||||
</router-link> |
|
||||
</el-dropdown-menu> |
|
||||
</el-dropdown> |
|
||||
<template v-if="hasPerm('manufactInspection:delete')"> |
|
||||
<template v-if="$store.getters.departmentId === 74"> |
|
||||
<el-button type="warning" icon="el-icon-circle-close" @click="errorBjd"> |
|
||||
异常收回 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-circle-close" @click="invalidBjd"> |
|
||||
作废 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
<el-button type="info" icon="el-icon-delete" style="margin-left: -1px;" @click="delBjd"> |
|
||||
删除 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
<el-button v-show="hasPerm('manufactInspection:printing')" type="success" icon="el-icon-printer" style="margin-left: -1px;" @click="printHzd"> |
|
||||
打印回执单 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.serialNumber" placeholder="报检单号/流水号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-date-picker v-model="listQuery.shouliriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择报检日期" style="width: 180px" /> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="bjdList" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
element-loading-text="拼命加载中" |
|
||||
size="small" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="45" /> |
|
||||
<el-table-column align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报检单号" prop="serialNumber" min-width="80" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" min-width="50" /> |
|
||||
<el-table-column align="center" :formatter="formatter.formatterCategory" label="检验类别" prop="jianyanleibie" min-width="50" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" min-width="150" /> |
|
||||
<el-table-column align="center" label="报检日期" prop="shouliriqi" min-width="60" /> |
|
||||
<el-table-column align="center" label="报检状态" prop="bjState" min-width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.bjState===0" type="success"> |
|
||||
新建 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===1" type="primary"> |
|
||||
待审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===2" type="info"> |
|
||||
已审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===3" type="warning"> |
|
||||
不予受理 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===4" type="warning"> |
|
||||
补正通知 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===5" type="danger"> |
|
||||
异常收回 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===6" type="danger"> |
|
||||
异常退回 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<!--<el-table-column align="center" label="交费状态" prop="jfstate" min-width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfstate===true" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="primary"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column>--> |
|
||||
<el-table-column align="center" label="设备台数" prop="totalNum" min-width="50" /> |
|
||||
<el-table-column align="center" label="操作" min-width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" size="mini" icon="edit" @click="editBjd(scope.$index)"> |
|
||||
编辑 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" style="float: left" @pagination="getList" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
export default { |
|
||||
name: 'ProjectList', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
let sbzldm |
|
||||
if (this.$store.getters.departmentId === 74) { |
|
||||
sbzldm = '1000' |
|
||||
} else if (this.$store.getters.departmentId === 68) { |
|
||||
sbzldm = '7000' |
|
||||
} else { |
|
||||
sbzldm = '2000' |
|
||||
} |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageSize: 20, // 每页条数 |
|
||||
orderBy: 'id desc', |
|
||||
jianyanleibie: 'ZJ', |
|
||||
zfState: false, |
|
||||
shebeizhongleidaima: sbzldm |
|
||||
}, |
|
||||
sbzlList: [], |
|
||||
ids: [], |
|
||||
multipleSelection: [] |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bjd-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/list', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.bjdList.doLayout() |
|
||||
}) |
|
||||
this.totalCount = data.total |
|
||||
}) |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageSize + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
// 表格单击选中行 |
|
||||
onRowClick(row) { |
|
||||
this.$refs.bjdList.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 获取选中行的bdjId |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
createBjd() { |
|
||||
console.log('新建制造监检') |
|
||||
this.$router.push({ |
|
||||
path: 'bjd/bjd-zj-input/:sbzldm/:formState/' |
|
||||
}) |
|
||||
}, |
|
||||
/** |
|
||||
* 异常收回 |
|
||||
*/ |
|
||||
errorBjd() { |
|
||||
this.$confirm('报检项目将进行异常收回,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message.error('只允许单台报检单收回') |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].bjState !== '2') { |
|
||||
this.$message.error('非审核通过数据不允许异常收回!') |
|
||||
return false |
|
||||
} |
|
||||
// 业务 |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToYcsh', |
|
||||
method: 'get', |
|
||||
params: { bjdId: this.multipleSelection[0].id } |
|
||||
}).then(data => { |
|
||||
if (data.success === 'ok') { |
|
||||
this.$message.success('异常收回成功!!请修改后重新审核通过!') |
|
||||
this.getList() |
|
||||
} else { |
|
||||
this.$message.warning('异常收回失败,存在已分配数据,请联系科室“异常退回”!') |
|
||||
} |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message.info('已取消收回') |
|
||||
}) |
|
||||
}, |
|
||||
/** |
|
||||
* 作废报检单 |
|
||||
* @returns {boolean} |
|
||||
*/ |
|
||||
invalidBjd: function() { |
|
||||
this.$confirm('共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message.error('请选中需要作废的数据!') |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message.error('只允许单台报检单作废') |
|
||||
return false |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToZf', |
|
||||
method: 'get', |
|
||||
params: { bjdIds: this.multipleSelection[0].id } |
|
||||
}).then(data => { |
|
||||
const msg = (data.bianhao ? '流水号为' + data.bianhao + '的项目关联的任务已经分配不能作废!' : '') + (data.count === 0 ? '' : data.count + '条项目作废成功') |
|
||||
if (msg) { |
|
||||
this.$message.info(msg) |
|
||||
} |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message.info('已取消作废') |
|
||||
}) |
|
||||
}, |
|
||||
// 删除报检单---只有未审核的报检单才能删除 |
|
||||
delBjd: function() { |
|
||||
this.ids.length = 0 |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要删除的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
if (this.multipleSelection[i].bjState === 2) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '选择的数据中有办结的项目,请重新选择!' |
|
||||
}) |
|
||||
return false |
|
||||
} else if (this.multipleSelection[i].bjState === 5) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '异常收回的数据,请通过作废按钮进行处理!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
this.ids.push(this.multipleSelection[i].id) |
|
||||
} |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/delBjd', |
|
||||
method: 'delete', |
|
||||
params: { bjdIds: this.ids.join(',') } |
|
||||
}).then(data => { |
|
||||
this.$message({ |
|
||||
message: data + '条项目删除成功', |
|
||||
type: 'success' |
|
||||
}) |
|
||||
this.getList() |
|
||||
}) |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
printHzd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ message: '只能打印一份报检单', type: 'error' }) |
|
||||
return |
|
||||
} |
|
||||
// this.api({ |
|
||||
// url: '/print/createHzdXml', |
|
||||
// method: 'post', |
|
||||
// params: { |
|
||||
// ids: this.multipleSelection[0].id, |
|
||||
// type: 'ysjl' |
|
||||
// } |
|
||||
// }).then(data => { |
|
||||
// this.printbutton = 'PDFPrint://' + data |
|
||||
// }) |
|
||||
this.apibjd({ |
|
||||
url: '/print/generateHzdPdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
bjdId: this.multipleSelection[0].id, |
|
||||
viewType: 'hzd', |
|
||||
generateType: true |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
this.$router.push({ path: '/preview/' + this.multipleSelection[0].id + '/hzd/urlPath?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
}) |
|
||||
}, |
|
||||
editBjd($index) { |
|
||||
const bjd = this.list[$index] |
|
||||
let type = '/update' |
|
||||
if (bjd.bjState === 2 || bjd.bjState === 3) { |
|
||||
type = '/finish' |
|
||||
} |
|
||||
this.$router.push({ path: '/bjd/bjd-zj-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + type }) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,444 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="success" icon="el-icon-printer" @click="batchPrintHzd"> |
|
||||
回执单 |
|
||||
</el-button> |
|
||||
<el-button type="warning" icon="el-icon-circle-close" @click="errorBjd"> |
|
||||
异常收回 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-circle-close" @click="invalidBjd"> |
|
||||
作废 |
|
||||
</el-button> |
|
||||
<div style="float: right;margin-top:8px;"> |
|
||||
<span class="identification" style="background-color: #08bdff;"> </span><span>有新上传资料</span> |
|
||||
<span class="identification" style="background-color: #08bdff;"> </span><span>纸质资料</span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.serialNumber" placeholder="报检单号/流水号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.zhizaodanwei" placeholder="制造单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<br> |
|
||||
<el-date-picker v-model="listQuery.shouliriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择报检日期" style="width: 180px" /> |
|
||||
<el-input v-model="listQuery.shigongdanwei" placeholder="施工单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<span class="radio-group-label">报检状态:</span> |
|
||||
<el-radio-group v-model="listQuery.bjState" @change="handleFilter"> |
|
||||
<el-radio :label="undefined"> |
|
||||
全部 |
|
||||
</el-radio> |
|
||||
<el-radio :label="0"> |
|
||||
新建/预审 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
待审核 |
|
||||
</el-radio> |
|
||||
<el-radio :label="2"> |
|
||||
已审核 |
|
||||
</el-radio> |
|
||||
<el-radio :label="3"> |
|
||||
不予受理 |
|
||||
</el-radio> |
|
||||
<el-radio :label="4"> |
|
||||
补证通知 |
|
||||
</el-radio> |
|
||||
<el-radio :label="5"> |
|
||||
异常收回 |
|
||||
</el-radio> |
|
||||
<el-radio :label="6"> |
|
||||
异常退回 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="bjdList" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
element-loading-text="拼命加载中" |
|
||||
size="small" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
:row-class-name="tableRowZiliao" |
|
||||
stripe |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="45" /> |
|
||||
<el-table-column align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报检单号/流水号" prop="serialNumber" min-width="80" /> |
|
||||
<el-table-column align="center" label="设备种类" prop="shebeizhonglei" min-width="50" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" /> |
|
||||
<el-table-column align="center" label="施工单位" prop="shigongdanwei" min-width="150" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" min-width="120" /> |
|
||||
<el-table-column align="center" label="报检日期" prop="baojianriqi" min-width="50" /> |
|
||||
<el-table-column align="center" label="报检状态" prop="bjState" min-width="55"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.bjState===0" type="success"> |
|
||||
新建/预审 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===1" type="primary"> |
|
||||
待审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===2" type="info"> |
|
||||
已审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===3" type="warning"> |
|
||||
不予受理 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===4" type="warning"> |
|
||||
补正通知 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===5" type="danger"> |
|
||||
异常收回 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===6" type="danger"> |
|
||||
异常退回 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="设备台数" prop="totalNum" min-width="40" /> |
|
||||
<el-table-column align="center" label="受理人员" prop="shouliren" min-width="50" /> |
|
||||
<el-table-column align="center" label="资料种类" prop="ziliaozhonglei" min-width="55"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.ziliaozhonglei === 1" type="success"> |
|
||||
电子资料 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.ziliaozhonglei === 2" type="primary"> |
|
||||
纸质资料 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.ziliaozhonglei === 3" type="primary"> |
|
||||
大厅纸质 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="info"> |
|
||||
暂无 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="设备类型" prop="shebeileixing" min-width="80" /> |
|
||||
<el-table-column align="center" label="操作" min-width="40"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" size="mini" circle icon="el-icon-edit" title="编辑" @click="editBjd(scope.$index)" /> |
|
||||
<el-button v-show="scope.row.bjState === 3 || scope.row.bjState === 4" size="mini" type="info" icon="el-icon-message" title="查看原因" circle @click="viewInfo(scope.row.bjdBeizhu)" /> |
|
||||
<el-button v-show="scope.row.bjState === 2 || scope.row.bjState === 5 || scope.row.bjState === 6" type="success" size="mini" circle icon="el-icon-view" title="预览回执单" @click="viewHzd(scope.row.id)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" style="float: left" @pagination="getList" /> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
// import store from '../../store' |
|
||||
// import router from '../../router' |
|
||||
export default { |
|
||||
name: 'ProjectZLSCList', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageSize: 20, // 每页条数 |
|
||||
orderBy: 'id desc', |
|
||||
zfState: false, |
|
||||
shoulikeshi: undefined, |
|
||||
shouliren: undefined, |
|
||||
bjState: undefined |
|
||||
}, |
|
||||
sbzlList: [], |
|
||||
ids: '', |
|
||||
multipleSelection: [], |
|
||||
params: { |
|
||||
bjdIds: this.ids |
|
||||
}, |
|
||||
printbutton: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bjd-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/listzlsc', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.total |
|
||||
}) |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageSize + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
handleCommand(item) { |
|
||||
this.$router.push({ path: '/bjd/bjd-dj-input/null/' + item.value + '/' + item.label + '/newBuild' }) |
|
||||
}, |
|
||||
// 表格单击选中行 |
|
||||
onRowClick(row) { |
|
||||
this.$refs.bjdList.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 获取选中行的bdjId |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
handleDialogSelectionChange(val) { |
|
||||
this.selection = val |
|
||||
}, |
|
||||
// 作废报检单 |
|
||||
invalidBjd: function() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要删除的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
this.$confirm('共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToZf', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection.map(rw => { |
|
||||
return rw.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.$message({ |
|
||||
message: (data.bianhao !== null && data.bianhao !== undefined ? '流水号为' + data.bianhao + '的项目关联的任务已经分配不能作废!' : '') + (data.count === 0 ? '' : data.count + '条项目作废成功'), |
|
||||
type: 'info' |
|
||||
}) |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消作废' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
editBjd($index) { |
|
||||
const bjd = this.list[$index] |
|
||||
let type = '/update' |
|
||||
if (bjd.bjState === 2 || bjd.bjState === 3) { |
|
||||
type = '/finish' |
|
||||
} |
|
||||
if (bjd.jianyanleibie === 'DJ') { |
|
||||
this.$router.push({ path: '/bjd/bjd-dj-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/' + bjd.shebeizhonglei + type }) |
|
||||
} else if (bjd.jianyanleibie === 'JJ') { |
|
||||
this.$router.push({ path: '/bjd/bjd-jj-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/' + bjd.shebeizhonglei + type }) |
|
||||
} |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
batchPrintHzd() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzdBatch', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListingBatch', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
list: data, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (data === 'success') { |
|
||||
this.preview({ |
|
||||
url: '/print/createXmlOther', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(','), |
|
||||
type: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
}) |
|
||||
} else { |
|
||||
this.$message({ message: '未能成功调用打印程序!', type: 'error' }) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
printHzd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ message: '只能打印一份报检单', type: 'error' }) |
|
||||
return |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzd', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.bjd, |
|
||||
paramList: data.renwu, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
viewInfo(reason) { |
|
||||
this.$message({ message: reason, type: 'info' }) |
|
||||
}, |
|
||||
viewHzd(bjdid) { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzd', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: bjdid |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.bjd, |
|
||||
paramList: data.renwu, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
errorBjd() { |
|
||||
// 异常收回 |
|
||||
this.$confirm('报检项目将进行异常收回,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message({ message: '只允许单台报检单收回', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].bjState !== '2') { |
|
||||
this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
// 业务 |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToYcsh', |
|
||||
method: 'get', |
|
||||
params: { bjdId: this.multipleSelection[0].id } |
|
||||
}).then(data => { |
|
||||
if (data.success === 'ok') { |
|
||||
this.$message({ |
|
||||
message: '异常收回成功!!请修改后重新审核通过!', |
|
||||
type: 'success' |
|
||||
}) |
|
||||
this.getList() |
|
||||
} else { |
|
||||
this.$message({ |
|
||||
message: '异常收回失败,存在已分配数据,请联系科室“异常退回”!', |
|
||||
type: 'warning' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消收回' |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
tableRowZiliao({ row, rowIndex }) { |
|
||||
if (row.ziliaoState) { |
|
||||
return 'ziliaoupload-row' |
|
||||
} |
|
||||
if (row.ziliaozhonglei === 2) { |
|
||||
return 'ziliaozhonglei-row' |
|
||||
} |
|
||||
return '' |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style> |
|
||||
/** 允许终检 */ |
|
||||
.el-table .ziliaoupload-row { |
|
||||
color: #08bdff; |
|
||||
} |
|
||||
.el_table .ziliaozhonglei-row { |
|
||||
color: #623615; |
|
||||
} |
|
||||
</style> |
|
@ -1,509 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="success" icon="el-icon-printer" @click="batchPrintHzd"> |
|
||||
回执单 |
|
||||
</el-button> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="editRenlingren"> |
|
||||
指派资料审核人 |
|
||||
</el-button> |
|
||||
<el-button v-show="this.$store.getters.username !== 'yangyq' && this.$store.getters.username !== 'shiting'" type="warning" icon="el-icon-edit" @click="byslBjd"> |
|
||||
允许不予受理 |
|
||||
</el-button> |
|
||||
<el-button type="warning" icon="el-icon-circle-close" @click="errorBjd"> |
|
||||
异常收回 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-circle-close" @click="invalidBjd"> |
|
||||
作废 |
|
||||
</el-button> |
|
||||
<div style="float: right;margin-top:8px;"> |
|
||||
<span class="identification" style="background-color: #08bdff;"> </span><span>有新上传资料</span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.serialNumber" placeholder="报检单号/流水号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" clearable> |
|
||||
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.zhizaodanwei" placeholder="制造单位名称" clearable style="width: 300px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-date-picker v-model="listQuery.shouliriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择报检日期" style="width: 180px" /> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<br> |
|
||||
<span class="radio-group-label">报检状态:</span> |
|
||||
<el-radio-group v-model="listQuery.bjState" @change="handleFilter"> |
|
||||
<el-radio :label="undefined"> |
|
||||
全部 |
|
||||
</el-radio> |
|
||||
<el-radio :label="0"> |
|
||||
新建/预审 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
待审核 |
|
||||
</el-radio> |
|
||||
<el-radio :label="2"> |
|
||||
已审核 |
|
||||
</el-radio> |
|
||||
<el-radio :label="3"> |
|
||||
不予受理 |
|
||||
</el-radio> |
|
||||
<el-radio :label="4"> |
|
||||
补证通知 |
|
||||
</el-radio> |
|
||||
<el-radio :label="5"> |
|
||||
异常收回 |
|
||||
</el-radio> |
|
||||
<el-radio :label="6"> |
|
||||
异常退回 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="bjdList" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
element-loading-text="拼命加载中" |
|
||||
size="small" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
:row-class-name="tableRowZiliao" |
|
||||
stripe |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="45" /> |
|
||||
<el-table-column align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报检单号/流水号" prop="serialNumber" min-width="70" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" min-width="150" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" min-width="120" /> |
|
||||
<el-table-column align="center" label="报检日期" prop="baojianriqi" min-width="50" /> |
|
||||
<el-table-column align="center" label="报检状态" prop="bjState" min-width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.bjState===0" type="success"> |
|
||||
新建/预审 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===1" type="primary"> |
|
||||
待审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===2" type="info"> |
|
||||
已审核 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===3" type="warning"> |
|
||||
不予受理 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===4" type="warning"> |
|
||||
补正通知 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===5" type="danger"> |
|
||||
异常收回 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.bjState===6" type="danger"> |
|
||||
异常退回 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="设备台数" prop="totalNum" min-width="40" /> |
|
||||
<el-table-column align="center" :formatter="formatter.getChineseName" label="资料认领人" prop="ziliaorenlingren" /> |
|
||||
<el-table-column align="center" label="受理人员" prop="shouliren" min-width="50" /> |
|
||||
<el-table-column align="center" label="资料种类" prop="ziliaozhonglei" min-width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.ziliaozhonglei === 1" type="success"> |
|
||||
电子资料 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.ziliaozhonglei === 2" type="primary"> |
|
||||
纸质资料 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.ziliaozhonglei === 3" type="primary"> |
|
||||
大厅纸质 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="info"> |
|
||||
暂无 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="不予受理" prop="byslState" min-width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="!scope.row.byslState" type="info"> |
|
||||
不允许 |
|
||||
</el-tag> |
|
||||
<el-tag v-else-if="scope.row.byslState" type="success"> |
|
||||
已允许 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="操作" min-width="40"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" size="mini" circle icon="el-icon-edit" title="编辑" @click="editBjd(scope.$index)" /> |
|
||||
<el-button v-show="scope.row.bjState === 3 || scope.row.bjState === 4" size="mini" type="info" icon="el-icon-message" title="查看原因" circle @click="viewInfo(scope.row.bjdBeizhu)" /> |
|
||||
<el-button v-show="scope.row.bjState === 2 || scope.row.bjState === 5 || scope.row.bjState === 6" type="success" size="mini" circle icon="el-icon-view" title="预览回执单" @click="viewHzd(scope.row.id)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" style="float: left" @pagination="getList" /> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
// import store from '../../store' |
|
||||
// import router from '../../router' |
|
||||
export default { |
|
||||
name: 'ProjectZLSCListAll', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageSize: 20, // 每页条数 |
|
||||
orderBy: 'id desc', |
|
||||
zfState: false, |
|
||||
shoulikeshi: undefined, |
|
||||
shouliren: undefined, |
|
||||
bjState: undefined, |
|
||||
ziliaorenlingren: ',', |
|
||||
dataSource: 1 |
|
||||
}, |
|
||||
sbzlList: [], |
|
||||
ids: '', |
|
||||
multipleSelection: [], |
|
||||
params: { |
|
||||
bjdIds: this.ids |
|
||||
}, |
|
||||
printbutton: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bjd-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/listzlsc', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.total |
|
||||
}) |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageSize + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
handleCommand(item) { |
|
||||
this.$router.push({ path: '/bjd/bjd-dj-input/null/' + item.value + '/' + item.label + '/newBuild' }) |
|
||||
}, |
|
||||
// 表格单击选中行 |
|
||||
onRowClick(row) { |
|
||||
this.$refs.bjdList.toggleRowSelection(row) |
|
||||
}, |
|
||||
// 获取选中行的bdjId |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
handleDialogSelectionChange(val) { |
|
||||
this.selection = val |
|
||||
}, |
|
||||
// 作废报检单 |
|
||||
invalidBjd: function() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要删除的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
this.$confirm('共' + this.multipleSelection.length + '条报检项目将作废,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToZf', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection.map(rw => { |
|
||||
return rw.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.$message({ |
|
||||
message: (data.bianhao !== null && data.bianhao !== undefined ? '流水号为' + data.bianhao + '的项目关联的任务已经分配不能作废!' : '') + (data.count === 0 ? '' : data.count + '条项目作废成功'), |
|
||||
type: 'info' |
|
||||
}) |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消作废' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
byslBjd() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要同意不予受理的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
this.$confirm('共' + this.multipleSelection.length + '条报检项目允许不予受理操作,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
this.ids += this.multipleSelection[i].id + ',' |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdByslState', |
|
||||
method: 'post', |
|
||||
data: { bjdids: this.ids } |
|
||||
}).then(data => { |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消作废' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
editBjd($index) { |
|
||||
const bjd = this.list[$index] |
|
||||
let type = '/update' |
|
||||
if (bjd.bjState === 2 || bjd.bjState === 3) { |
|
||||
type = '/finish' |
|
||||
} |
|
||||
if (bjd.jianyanleibie === 'DJ') { |
|
||||
this.$router.push({ path: '/bjd/bjd-dj-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/' + bjd.shebeizhonglei + type }) |
|
||||
} else if (bjd.jianyanleibie === 'JJ') { |
|
||||
this.$router.push({ path: '/bjd/bjd-jj-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/' + bjd.shebeizhonglei + type }) |
|
||||
} |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
batchPrintHzd() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ message: '请选择至少一条数据进行打印!', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzdBatch', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListingBatch', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
list: data, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (data === 'success') { |
|
||||
this.preview({ |
|
||||
url: '/print/createXmlOther', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(','), |
|
||||
type: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
}) |
|
||||
} else { |
|
||||
this.$message({ message: '未能成功调用打印程序!', type: 'error' }) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
// 打印回执单 |
|
||||
printHzd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ message: '只能打印一份报检单', type: 'error' }) |
|
||||
return |
|
||||
} |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzd', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.bjd, |
|
||||
paramList: data.renwu, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
viewInfo(reason) { |
|
||||
this.$message({ message: reason, type: 'info' }) |
|
||||
}, |
|
||||
viewHzd(bjdid) { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/printHzd', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
bjdIds: bjdid |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.bjd, |
|
||||
paramList: data.renwu, |
|
||||
viewType: 'HZD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
// router.push({ path: '/preview/1/1/urlPath?src=' + store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
errorBjd() { |
|
||||
// 异常收回 |
|
||||
this.$confirm('报检项目将进行异常收回,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message({ message: '只允许单台报检单收回', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].bjState !== '2') { |
|
||||
this.$message({ message: '非审核通过数据不允许异常收回!', type: 'error' }) |
|
||||
return false |
|
||||
} |
|
||||
// 业务 |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdToYcsh', |
|
||||
method: 'get', |
|
||||
params: { bjdId: this.multipleSelection[0].id } |
|
||||
}).then(data => { |
|
||||
if (data.success === 'ok') { |
|
||||
this.$message({ |
|
||||
message: '异常收回成功!!请修改后重新审核通过!', |
|
||||
type: 'success' |
|
||||
}) |
|
||||
this.getList() |
|
||||
} else { |
|
||||
this.$message({ |
|
||||
message: '异常收回失败,存在已分配数据,请联系科室“异常退回”!', |
|
||||
type: 'warning' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消收回' |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
editRenlingren() { |
|
||||
this.$confirm('您正在修改资料审核人,是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.apibjd({ |
|
||||
url: '/bjd/updBjdZlshr', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
bjdids: this.$refs.bjdList.selection.map(bjd => { |
|
||||
return bjd.id |
|
||||
}).join(',') |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.getList() |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '已取消操作!' |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
tableRowZiliao({ row, rowIndex }) { |
|
||||
if (row.ziliaoState) { |
|
||||
return 'ziliaoupload-row' |
|
||||
} |
|
||||
return '' |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style> |
|
||||
/** 允许终检 */ |
|
||||
.el-table .ziliaoupload-row { |
|
||||
color: #08bdff; |
|
||||
} |
|
||||
</style> |
|
@ -0,0 +1,316 @@ |
|||||
|
<template> |
||||
|
<el-dialog title="领用、借用管理" width="60%" style="margin-top:-5%;" :visible.sync="dialogVisible" @close="closeDialog"> |
||||
|
<el-form> |
||||
|
<div class="filter-container"> |
||||
|
<!--头部功能--> |
||||
|
<div class="head-container"> |
||||
|
<div v-if="crud.props.searchToggle"> |
||||
|
<el-select |
||||
|
v-model="query.applicantId" |
||||
|
filterable |
||||
|
placeholder="请选择申请人" |
||||
|
class="filter-item" |
||||
|
clearable |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
> |
||||
|
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
||||
|
</el-select> |
||||
|
<el-date-picker |
||||
|
v-model="query.applyDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择申请使用日期" |
||||
|
style="width: 200px;" |
||||
|
class="filter-item" |
||||
|
clearable |
||||
|
@keyup.enter.native="crud.toQuery" |
||||
|
/> |
||||
|
<TreeSelect |
||||
|
ref="treeSelect" |
||||
|
:props="treeSelectProps" |
||||
|
placeholder-select="请选择申请科室" |
||||
|
:options="departmentTree" |
||||
|
:clearable="true" |
||||
|
:accordion="true" |
||||
|
class="filter-item" |
||||
|
@getValue="getDepartmentId($event)" |
||||
|
/> |
||||
|
<query :crud="crud" /> |
||||
|
</div> |
||||
|
<crud :permission="permission" /> |
||||
|
</div> |
||||
|
<!--表格内容--> |
||||
|
<CustomTable ref="customTable" :col-configs="colConfigs" :columns="columns" :crud="crud"> |
||||
|
<el-table-column |
||||
|
v-if="checkPermission(permission.edit)" |
||||
|
slot="operation" |
||||
|
align="center" |
||||
|
width="100" |
||||
|
label="操作" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<Edit :data="scope.row" :disabled-edit="false" :permission="permission" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</CustomTable> |
||||
|
<pagination /> |
||||
|
<el-dialog |
||||
|
:before-close="crud.cancelCU" |
||||
|
:visible="crud.status.editor > 0" |
||||
|
:title="crud.status.title" |
||||
|
:append-to-body="true" |
||||
|
> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" inline> |
||||
|
<el-form-item label="当前使用人:" prop="currentUserId"> |
||||
|
<el-select v-model="form.currentUserId" filterable placeholder="请选择当前使用人" clearable> |
||||
|
<el-option |
||||
|
v-for="item in userList" |
||||
|
:key="item.id" |
||||
|
:label="item.nickname" |
||||
|
:value="item.id" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="当前使用科室:" prop="currentDepartmentId"> |
||||
|
<TreeSelect |
||||
|
v-if="crud.status.editor > 0" |
||||
|
ref="treeSelect" |
||||
|
:props="treeSelectProps" |
||||
|
placeholder-select="请选择当前使用科室" |
||||
|
:options="departmentTree" |
||||
|
:value="currentDepartmentId" |
||||
|
:clearable="true" |
||||
|
:accordion="true" |
||||
|
style="width: 215px;" |
||||
|
@getValue="getCurrentUserDepartmentValue($event)" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="申请人:" prop="applicantId"> |
||||
|
<el-select v-model="form.applicantId" filterable placeholder="请选择申请人" clearable> |
||||
|
<el-option |
||||
|
v-for="item in userList" |
||||
|
:key="item.id" |
||||
|
:label="item.nickname" |
||||
|
:value="item.id" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="申请科室:" prop="applyDepartmentId"> |
||||
|
<TreeSelect |
||||
|
v-if="crud.status.editor > 0" |
||||
|
ref="treeSelect" |
||||
|
:props="treeSelectProps" |
||||
|
placeholder-select="请选择申请科室" |
||||
|
:options="departmentTree" |
||||
|
:value="applyDepartmentId" |
||||
|
:clearable="true" |
||||
|
:accordion="true" |
||||
|
style="width: 215px;" |
||||
|
@getValue="getApplyDepartmentValue($event)" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="申请使用日期:" prop="applyDate"> |
||||
|
<el-date-picker |
||||
|
v-model="form.applyDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择申请使用日期" |
||||
|
style="width: 215px;" |
||||
|
class="filter-item" |
||||
|
clearable |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="使用状态:" prop="usageStatus"> |
||||
|
<el-radio v-model="form.usageStatus" :label="false"> |
||||
|
领用 |
||||
|
</el-radio> |
||||
|
<el-radio v-model="form.usageStatus" :label="true"> |
||||
|
借用 |
||||
|
</el-radio> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注:" prop="remark"> |
||||
|
<el-input |
||||
|
v-model="form.remark" |
||||
|
style="width: 560px;" |
||||
|
maxlength="200" |
||||
|
type="textarea" |
||||
|
placeholder="请填写备注信息" |
||||
|
:autosize="{ minRows: 5, maxRows: 5}" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="crud.cancelCU"> |
||||
|
取 消 |
||||
|
</el-button> |
||||
|
<el-button type="primary" @click="crud.submitCU"> |
||||
|
确 认 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import CRUD, { form, header, presenter } from '@/components/Crud/crud' |
||||
|
import Crud from '@/components/Crud' |
||||
|
import Query from '@/components/Crud/Query' |
||||
|
import CustomTable from '@/components/Crud/Table' |
||||
|
import Edit from '@/components/Crud/Edit' |
||||
|
import Pagination from '@/components/Crud/Pagination' |
||||
|
import InstrumentMove from '@/api/instrument_move' |
||||
|
import TreeSelect from '@/components/TreeSelect' |
||||
|
|
||||
|
// crud交由presenter持有 |
||||
|
const defaultCrud = presenter(CRUD({ |
||||
|
title: '领用、借用管理', |
||||
|
url: '/move', |
||||
|
orderBy: ['id desc'], |
||||
|
crudMethod: { ...InstrumentMove } |
||||
|
})) |
||||
|
|
||||
|
// 设置初始form |
||||
|
const defaultForm = form({ |
||||
|
id: null, |
||||
|
usageStatus: false, |
||||
|
applicantId: null, |
||||
|
applyDepartmentId: null, |
||||
|
applyDate: '', |
||||
|
currentUserId: '', |
||||
|
currentDepartmentId: null, |
||||
|
remark: '' |
||||
|
}) |
||||
|
|
||||
|
// 自定义模板内容 |
||||
|
const PrefixPlusText = { |
||||
|
props: ['value'], |
||||
|
template: ` |
||||
|
<el-tag :type="value ? 'warning' : 'success'">{{ value ? '借用' : '领用' }}</el-tag>` |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
name: 'Move', |
||||
|
components: { Crud, Query, CustomTable, Pagination, TreeSelect, Edit }, |
||||
|
mixins: [defaultCrud, defaultForm, header()], |
||||
|
props: { |
||||
|
instrumentId: { |
||||
|
type: Number, |
||||
|
default: 0, |
||||
|
required: true |
||||
|
}, |
||||
|
departmentTree: { |
||||
|
type: Array, |
||||
|
default() { |
||||
|
return [] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dialogVisible: false, |
||||
|
userList: this.$store.getters.allUserList, |
||||
|
treeSelectProps: { |
||||
|
children: 'children', |
||||
|
label: 'departmentName', |
||||
|
value: 'id' |
||||
|
}, |
||||
|
colConfigs: [ |
||||
|
{ prop: 'currentUserId', label: '当前使用人', align: 'center', formatter: this.formatter.formatterNickName }, |
||||
|
{ |
||||
|
prop: 'currentDepartmentId', |
||||
|
label: '当前使用科室', |
||||
|
align: 'center', |
||||
|
formatter: this.formatter.formatterDepartmentName |
||||
|
}, |
||||
|
{ prop: 'applicantId', label: '申请人', align: 'center', formatter: this.formatter.formatterNickName }, |
||||
|
{ |
||||
|
prop: 'applyDepartmentId', |
||||
|
label: '申请科室', |
||||
|
align: 'center', |
||||
|
formatter: this.formatter.formatterDepartmentName |
||||
|
}, |
||||
|
{ prop: 'applyDate', label: '申请使用日期', align: 'center' }, |
||||
|
{ prop: 'remark', label: '备注', align: 'center' }, |
||||
|
{ prop: 'usageStatus', label: '使用状态', align: 'center', component: PrefixPlusText }, |
||||
|
{ slot: 'operation' } |
||||
|
], |
||||
|
permission: { |
||||
|
add: ['instrument:add'], |
||||
|
edit: ['instrument:update'], |
||||
|
del: ['instrument:delete'] |
||||
|
}, |
||||
|
applyDepartmentId: 0, |
||||
|
currentDepartmentId: 0, |
||||
|
rules: { |
||||
|
currentUserId: [ |
||||
|
{ required: true, message: '请选择当前使用人', trigger: 'blur' } |
||||
|
], |
||||
|
currentDepartmentId: [ |
||||
|
{ required: true, message: '请选择当前使用科室', trigger: 'blur' } |
||||
|
], |
||||
|
applicantId: [ |
||||
|
{ required: true, message: '请选择申请人', trigger: 'blur' } |
||||
|
], |
||||
|
applyDepartmentId: [ |
||||
|
{ required: true, message: '请选择申请科室', trigger: 'blur' } |
||||
|
], |
||||
|
applyDate: [ |
||||
|
{ required: true, message: '请选择申请使用日期', trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.crud.optionShow = { |
||||
|
add: true, |
||||
|
edit: false, |
||||
|
del: true |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 刷新前做的操作 |
||||
|
[CRUD.HOOK.beforeRefresh](crud) { |
||||
|
crud.query.instrumentId = this.instrumentId |
||||
|
}, |
||||
|
// 新增前做的操作 |
||||
|
[CRUD.HOOK.beforeToAdd](crud, form) { |
||||
|
this.applyDepartmentId = 0 |
||||
|
this.currentDepartmentId = 0 |
||||
|
form.instrumentId = this.instrumentId |
||||
|
}, |
||||
|
// 编辑框打开后做的操作 |
||||
|
[CRUD.HOOK.afterToEdit](crud, form) { |
||||
|
this.applyDepartmentId = form.applyDepartmentId |
||||
|
this.currentDepartmentId = form.currentDepartmentId |
||||
|
}, |
||||
|
// 编辑框取消后的操作 |
||||
|
[CRUD.HOOK.afterEditCancel]() { |
||||
|
this.applyDepartmentId = 0 |
||||
|
this.currentDepartmentId = 0 |
||||
|
}, |
||||
|
// 组件初始化 |
||||
|
init() { |
||||
|
this.dialogVisible = true |
||||
|
}, |
||||
|
// 关闭弹窗 |
||||
|
closeDialog() { |
||||
|
this.$emit('close') |
||||
|
}, |
||||
|
// 给检索条件赋值(申请部门主键) |
||||
|
getDepartmentId(value) { |
||||
|
this.query.applyDepartmentId = value === 0 ? '' : value |
||||
|
}, |
||||
|
// from表单当前使用部门赋值 |
||||
|
getCurrentUserDepartmentValue(value) { |
||||
|
this.form.currentDepartmentId = value |
||||
|
}, |
||||
|
// from表单申请部门赋值 |
||||
|
getApplyDepartmentValue(value) { |
||||
|
this.form.applyDepartmentId = value |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
@ -0,0 +1,557 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<!--头部选项--> |
||||
|
<div class="head-container"> |
||||
|
<div v-if="crud.props.searchToggle"> |
||||
|
<el-input v-model="query.equipmentNum" placeholder="请输入设备编号" style="width: 200px;" class="filter-item" clearable @keyup.enter.native="crud.toQuery" /> |
||||
|
<el-input v-model="query.customName" placeholder="请输入新名称" style="width: 200px;" class="filter-item" clearable @keyup.enter.native="crud.toQuery" /> |
||||
|
<el-input v-model="query.unitPrice" placeholder="请输入单价" style="width: 150px;" class="filter-item" clearable @keyup.enter.native="crud.toQuery" /> |
||||
|
<!-- <el-cascader |
||||
|
ref="queryCascader" |
||||
|
v-model="query.classCode" |
||||
|
class="filter-item" |
||||
|
:options="dicAssetTree" |
||||
|
:props="{ value: 'id', label: 'name', checkStrictly: true }" |
||||
|
:show-all-levels="false" |
||||
|
clearable |
||||
|
filterable |
||||
|
placeholder="选择设备名称" |
||||
|
@change="queryCascaderChange" |
||||
|
/> --> |
||||
|
<el-select v-model="query.measureState" placeholder="请选择计量状态" style="width: 150px;" class="filter-item" clearable> |
||||
|
<el-option v-for="item in measureStateList" :key="item.value" :label="item.label" :value="item.value" /> |
||||
|
</el-select> |
||||
|
<el-select v-model="query.ifOverdue" placeholder="请选择超期状态" style="width: 150px;" class="filter-item" clearable> |
||||
|
<el-option v-for="item in ifOverdueList" :key="item.value" :label="item.label" :value="item.value" /> |
||||
|
</el-select> |
||||
|
<el-select v-model="query.useState" placeholder="请选择使用状况" style="width: 150px;" class="filter-item" clearable> |
||||
|
<el-option v-for="item in useStateList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
<TreeSelect ref="queryTreeSelect" :props="treeSelectProps" placeholder-select="请选择使用部门" :options="departmentTree" :clearable="true" :accordion="true" class="filter-item" @getValue="getDepartmentId($event)" /> |
||||
|
<query :crud="crud" /> |
||||
|
</div> |
||||
|
<crud :permission="permission"> |
||||
|
<el-upload |
||||
|
slot="right" |
||||
|
class="filter-item" |
||||
|
:show-file-list="false" |
||||
|
:before-upload="beforeUpload" |
||||
|
accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" |
||||
|
action="" |
||||
|
> |
||||
|
<el-button type="primary" icon="el-icon-upload"> |
||||
|
上传数据 |
||||
|
</el-button> |
||||
|
</el-upload> |
||||
|
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-edit-outline" :disabled="crud.selections.length !== 1" @click="moveAdministration(crud.selections)"> |
||||
|
领用、借用管理 |
||||
|
</el-button> |
||||
|
<el-button slot="right" class="filter-item" icon="el-icon-download" type="warning" @click="exportExcel"> |
||||
|
导出数据 |
||||
|
</el-button> |
||||
|
</crud> |
||||
|
</div> |
||||
|
<!--表格内容--> |
||||
|
<CustomTable ref="customTable" :col-configs="colConfigs" :columns="columns" :crud="crud" :row-class-name="getTableRowClassName"> |
||||
|
<el-table-column slot="operation" align="center" width="100" label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<Edit :permission="permission" :data="scope.row" :disabled-edit="false" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</CustomTable> |
||||
|
<pagination /> |
||||
|
<div style="float: right;margin-top:-18px;"> |
||||
|
<div style="width: 50px;float:left;margin-left: 20px;"> |
||||
|
预警: |
||||
|
</div> |
||||
|
<div class="identification" style="background-color:#FF8C00;" /> |
||||
|
<div style="width: 80px;float:left;margin-left: 50px;"> |
||||
|
超期: |
||||
|
</div> |
||||
|
<div class="identification" style="background-color:red;" /> |
||||
|
</div> |
||||
|
<el-dialog :before-close="crud.cancelCU" :visible="crud.status.editor > 0" :title="crud.status.title"> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" inline> |
||||
|
<el-tabs v-model="activeName"> |
||||
|
<el-tab-pane label="基本信息" name="first"> |
||||
|
<el-form-item label="资产编号:" prop="assetNum"> |
||||
|
<el-input v-model="form.assetNum" placeholder="请填写资产编号" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="设备编号:" prop="equipmentNum"> |
||||
|
<el-input v-model="form.equipmentNum" style="width: 215px;" placeholder="请填写资产编号" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="新名称:" prop="customName"> |
||||
|
<el-input v-model="form.customName" placeholder="请填写新名称" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="设备名称:" prop="classCode"> |
||||
|
<el-cascader |
||||
|
ref="cascaders" |
||||
|
v-model="parentId" |
||||
|
:options="dicAssetTree" |
||||
|
:props="{ value: 'id', label: 'name', checkStrictly: true }" |
||||
|
:show-all-levels="false" |
||||
|
clearable |
||||
|
filterable |
||||
|
placeholder="选择设备名称" |
||||
|
style="width: 100%" |
||||
|
@change="cascaderChange" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="品牌:" prop="brand"> |
||||
|
<el-input v-model="form.brand" placeholder="请填写品牌" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="规格型号:" prop="specifications"> |
||||
|
<el-input v-model="form.specifications" style="width: 215px;" placeholder="请填写规格型号" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="出厂编号:" prop="factoryNum"> |
||||
|
<el-input v-model="form.factoryNum" placeholder="请填写出厂编号" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="存放地点:" prop="location"> |
||||
|
<el-input v-model="form.location" style="width: 215px;" placeholder="请填写存放地点" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="购置日期:" prop="achieveDate"> |
||||
|
<el-date-picker v-model="form.achieveDate" style="width: 215px;" value-format="yyyy-MM-dd" clearable type="date" placeholder="选择购置日期" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="投入使用日期:" prop="commissioningDate"> |
||||
|
<el-date-picker v-model="form.commissioningDate" value-format="yyyy-MM-dd" style="width: 215px;" clearable type="date" placeholder="选择投入使用日期" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="备注:" prop="remark"> |
||||
|
<el-input v-model="form.remark" style="width: 560px;" maxlength="200" type="textarea" placeholder="请填写备注信息" /> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="费用信息" name="second"> |
||||
|
<el-form-item label="设备数量:" prop="quantity"> |
||||
|
<el-input v-model="form.quantity" placeholder="请填写设备数量" clearable type="number" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="单价:" prop="unitPrice"> |
||||
|
<el-input v-model="form.unitPrice" placeholder="请填写设备单价" clearable type="number" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="总价:" prop="totalPrice"> |
||||
|
<el-input v-model="form.totalPrice" placeholder="请填写设备总价" clearable type="number" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="价值类型:" prop="valueType"> |
||||
|
<el-select v-model="form.valueType" placeholder="请选择价值类型" clearable> |
||||
|
<el-option v-for="item in valueTypeList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="资产来源:" prop="assetSource"> |
||||
|
<el-select v-model="form.assetSource" placeholder="请选择资产来源" clearable> |
||||
|
<el-option v-for="item in assetSourceList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="经费来源:" prop="fundingSource"> |
||||
|
<el-select v-model="form.fundingSource" placeholder="请选择经费来源" clearable> |
||||
|
<el-option v-for="item in fundingSourceList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="采购组织形式:" prop="procurementType"> |
||||
|
<el-select v-model="form.procurementType" placeholder="请选择采购组织形式" clearable> |
||||
|
<el-option v-for="item in procurementTypeList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="累计折扣:" prop="discount"> |
||||
|
<el-input v-model="form.discount" placeholder="请填写累计折扣" clearable type="number" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="账面净值:" prop="netWorth"> |
||||
|
<el-input v-model="form.netWorth" placeholder="请填写账面净值" clearable type="number" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="折旧状态:" prop="depreciationState"> |
||||
|
<el-select v-model="form.depreciationState" placeholder="请选择折旧状态" clearable> |
||||
|
<el-option v-for="item in depreciationStateList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否入账:" prop="bookedState"> |
||||
|
<el-select v-model="form.bookedState" placeholder="请选择入账状态" clearable> |
||||
|
<el-option v-for="item in bookedStateList" :key="item.value" :label="item.label" :value="item.value" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="使用信息" name="third"> |
||||
|
<el-form-item label="使用科室:" prop="departmentId"> |
||||
|
<TreeSelect |
||||
|
v-if="crud.status.editor > 0" |
||||
|
:props="treeSelectProps" |
||||
|
:options="departmentTree" |
||||
|
:value="departmentId" |
||||
|
:clearable="true" |
||||
|
:accordion="true" |
||||
|
style="width: 215px;" |
||||
|
@getValue="getDepartmentValue($event)" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="使用人:" prop="principal"> |
||||
|
<el-select v-model="form.principal" filterable placeholder="请选择使用人" clearable> |
||||
|
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="产权单位:" prop="propertyUnit"> |
||||
|
<el-input v-model="form.propertyUnit" placeholder="请填写产权单位" clearable type="text" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="使用年限:" prop="useYear"> |
||||
|
<el-input v-model="form.useYear" placeholder="请填写使用年限" clearable type="number" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="使用状况:" prop="useState"> |
||||
|
<el-select v-model="form.useState" placeholder="请选择使用状况" clearable> |
||||
|
<el-option v-for="item in useStateList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="使用方向:" prop="useDirection"> |
||||
|
<el-select v-model="form.useDirection" placeholder="请选择使用方向" clearable> |
||||
|
<el-option v-for="item in useDirectionList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="使用用途:" prop="usePurpose"> |
||||
|
<el-select v-model="form.usePurpose" placeholder="请选择使用用途" clearable> |
||||
|
<el-option v-for="item in usePurposeList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="计量状态:" prop="measureState"> |
||||
|
<el-select v-model="form.measureState" placeholder="请选择计量状态" clearable @change="changeMeasure"> |
||||
|
<el-option v-for="item in measureStateList" :key="item.value" :label="item.label" :value="item.value" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item v-show="ifMeasure" label="校验周期:" prop="earlyWarningCycle"> |
||||
|
<el-select v-model="form.earlyWarningCycle" placeholder="请选择校验周期" clearable> |
||||
|
<el-option v-for="item in cycleList" :key="item.value" :label="item.label" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item v-show="ifMeasure" label="去年校验日期:" prop="checkLastDate"> |
||||
|
<el-date-picker v-model="form.checkLastDate" style="width: 215px;" value-format="yyyy-MM-dd" clearable type="date" placeholder="选择去年校验日期" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item v-show="ifMeasure" label="今年校验日期:" prop="checkDate"> |
||||
|
<el-date-picker v-model="form.checkDate" style="width: 215px;" value-format="yyyy-MM-dd" clearable type="date" placeholder="选择今年校验日期" /> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="crud.cancelCU"> |
||||
|
取 消 |
||||
|
</el-button> |
||||
|
<el-button type="primary" @click="crud.submitCU"> |
||||
|
确 认 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
<move v-if="moveDialogVisible" ref="move" :instrument-id="instrumentId" :department-tree="departmentTree" @close="resetChecks" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import CRUD, { form, header, presenter } from '@/components/Crud/crud' |
||||
|
import Crud from '@/components/Crud' |
||||
|
import Query from '@/components/Crud/Query' |
||||
|
import Edit from '@/components/Crud/Edit' |
||||
|
import CustomTable from '@/components/Crud/Table' |
||||
|
import Pagination from '@/components/Crud/Pagination' |
||||
|
import CrudInstrument from '@/api/instrument' |
||||
|
import TreeSelect from '@/components/TreeSelect' |
||||
|
// import { uploadInstrumentData } from '@/api/file' |
||||
|
import { getDicDataListByTypeName } from '@/api/dic_data' |
||||
|
import { getDepartmentTreeList } from '@/api/common' |
||||
|
import Move from './components/Move' |
||||
|
import { downloadFile, parseTime } from '@/utils' |
||||
|
|
||||
|
// crud交由presenter持有 |
||||
|
const defaultCrud = presenter(CRUD({ |
||||
|
title: '仪器设备', |
||||
|
url: '/instrument', |
||||
|
orderBy: ['id asc'], |
||||
|
crudMethod: { ...CrudInstrument } |
||||
|
})) |
||||
|
|
||||
|
// 设置初始form |
||||
|
const defaultForm = form({ |
||||
|
id: null, |
||||
|
assetNum: '', |
||||
|
equipmentNum: '', |
||||
|
customName: '', |
||||
|
equipmentName: '', |
||||
|
classCode: '', |
||||
|
brand: '', |
||||
|
specifications: '', |
||||
|
factoryNum: '', |
||||
|
location: '', |
||||
|
achieveDate: '', |
||||
|
commissioningDate: '', |
||||
|
remark: '', |
||||
|
quantity: '', |
||||
|
unitPrice: '', |
||||
|
totalPrice: '', |
||||
|
valueType: '', |
||||
|
assetSource: '', |
||||
|
fundingSource: '', |
||||
|
procurementType: '', |
||||
|
discount: '', |
||||
|
netWorth: '', |
||||
|
depreciationState: '', |
||||
|
bookedState: '', |
||||
|
departmentId: '', |
||||
|
principal: '', |
||||
|
propertyUnit: '', |
||||
|
useState: '', |
||||
|
useDirection: '', |
||||
|
useYear: '', |
||||
|
usePurpose: '', |
||||
|
measureState: '', |
||||
|
earlyWarningCycle: '', |
||||
|
checkLastDate: '', |
||||
|
checkDate: '' |
||||
|
}) |
||||
|
|
||||
|
// 自定义模板内容 |
||||
|
const PrefixPlusText = { |
||||
|
props: ['value', 'functions'], |
||||
|
template: ` |
||||
|
<el-tag v-if="functions(value) === '在用'" effect="dark"><span v-html="functions(value)"></span></el-tag> |
||||
|
<el-tag v-else-if="functions(value) === '停用'" type="danger" effect="dark"><span v-html="functions(value)"></span></el-tag> |
||||
|
<el-tag v-else-if="functions(value) === '待报废'" type="warning" effect="dark"><span v-html="functions(value)"></span></el-tag> |
||||
|
<el-tag v-else type="info" effect="dark"><span v-html="functions(value)"></span></el-tag> |
||||
|
` |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
name: 'InstrumentList', |
||||
|
components: { Pagination, Query, Crud, CustomTable, Edit, TreeSelect, Move }, |
||||
|
mixins: [defaultCrud, defaultForm, header()], |
||||
|
data() { |
||||
|
return { |
||||
|
colConfigs: [ |
||||
|
{ prop: 'equipmentNum', label: '设备编号', align: 'center' }, |
||||
|
{ prop: 'customName', label: '新名称', align: 'center' }, |
||||
|
{ prop: 'brand', label: '品牌', align: 'center' }, |
||||
|
{ prop: 'factoryNum', label: '出厂编号', align: 'center' }, |
||||
|
{ prop: 'achieveDate', label: '购置时间', align: 'center' }, |
||||
|
{ prop: 'quantity', label: '数量', align: 'center' }, |
||||
|
{ prop: 'unitPrice', label: '单价', align: 'center' }, |
||||
|
{ prop: 'totalPrice', label: '总价', align: 'center' }, |
||||
|
{ prop: 'departmentId', label: '使用部门', align: 'center', formatter: this.formatter.formatterDepartmentName }, |
||||
|
{ prop: 'principal', label: '使用人', align: 'center', formatter: this.formatter.formatterNickName }, |
||||
|
{ prop: 'useState', label: '使用状况', align: 'center', component: PrefixPlusText, componentFunction: this.formatter.formatterDicData }, |
||||
|
{ slot: 'operation' } |
||||
|
], |
||||
|
permission: { |
||||
|
add: ['instrument:add'], |
||||
|
edit: ['instrument:update'], |
||||
|
del: ['instrument:delete'] |
||||
|
}, |
||||
|
dicAssetTree: [], |
||||
|
parentId: [], |
||||
|
activeName: 'first', |
||||
|
valueTypeList: [], |
||||
|
assetSourceList: [], |
||||
|
fundingSourceList: [], |
||||
|
procurementTypeList: [], |
||||
|
depreciationStateList: [], |
||||
|
bookedStateList: [ |
||||
|
{ label: '已入账', value: true }, |
||||
|
{ label: '未入账', value: false } |
||||
|
], |
||||
|
departmentTree: [], |
||||
|
departmentId: 0, |
||||
|
treeSelectProps: { |
||||
|
children: 'children', |
||||
|
label: 'departmentName', |
||||
|
value: 'id' |
||||
|
}, |
||||
|
userList: this.$store.getters.allUserList, |
||||
|
useStateList: [], |
||||
|
useDirectionList: [], |
||||
|
usePurposeList: [], |
||||
|
measureStateList: [ |
||||
|
{ value: true, label: '计量' }, |
||||
|
{ value: false, label: '非计量' } |
||||
|
], |
||||
|
ifOverdueList: [ |
||||
|
{ value: 0, label: '正常' }, |
||||
|
{ value: 1, label: '预警' }, |
||||
|
{ value: 2, label: '超期' } |
||||
|
], |
||||
|
cycleList: [], |
||||
|
rules: { |
||||
|
departmentId: [ |
||||
|
{ required: true, message: '请选择使用部门', trigger: 'blur' } |
||||
|
], |
||||
|
quantity: [ |
||||
|
{ required: true, message: '请填写设备数量', trigger: 'blur' } |
||||
|
], |
||||
|
unitPrice: [ |
||||
|
{ required: true, message: '请填写设备单价', trigger: 'blur' } |
||||
|
], |
||||
|
totalPrice: [ |
||||
|
{ required: true, message: '请填写设备总价', trigger: 'blur' } |
||||
|
], |
||||
|
useState: [ |
||||
|
{ required: true, message: '请选择使用状况', trigger: 'blur' } |
||||
|
], |
||||
|
useYear: [ |
||||
|
{ required: true, message: '请填写使用年限', trigger: 'blur' } |
||||
|
], |
||||
|
measureState: [ |
||||
|
{ required: true, message: '请选择计量状态', trigger: 'blur' } |
||||
|
], |
||||
|
principal: [ |
||||
|
{ required: true, message: '请选择使用人', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
instrumentId: 0, |
||||
|
moveDialogVisible: false, |
||||
|
ifMeasure: false |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.initDicDataList() |
||||
|
this.getDepartmentTree() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 刷新之后重置部门查询的值 |
||||
|
[CRUD.HOOK.afterResetQuery]() { |
||||
|
if (this.$refs.queryTreeSelect) { |
||||
|
this.$refs.queryTreeSelect.clearHandle() |
||||
|
} |
||||
|
}, |
||||
|
// 新增与编辑前做的操作 |
||||
|
[CRUD.HOOK.afterToCU]() { |
||||
|
this.activeName = 'first' |
||||
|
}, |
||||
|
// 编辑框打开后做的操作 |
||||
|
[CRUD.HOOK.afterToEdit](crud, form) { |
||||
|
this.departmentId = form.departmentId |
||||
|
this.ifMeasure = form.measureState |
||||
|
}, |
||||
|
// 编辑框取消后的操作 |
||||
|
[CRUD.HOOK.afterEditCancel]() { |
||||
|
this.departmentId = 0 |
||||
|
this.ifMeasure = false |
||||
|
}, |
||||
|
// EXCEL上传方法 |
||||
|
beforeUpload(file) { |
||||
|
const isExcel = file.type === 'application/vnd.ms-excel' || file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
||||
|
if (!isExcel) { |
||||
|
this.$notify.error('只能上传xls/xlsx格式的文件') |
||||
|
return false |
||||
|
} |
||||
|
const fd = new FormData() |
||||
|
fd.append('file', file) |
||||
|
fd.append('type', 3) |
||||
|
// uploadInstrumentData(fd).then(() => { |
||||
|
// this.$notify.success('导入数据成功。') |
||||
|
// this.crud.toQuery() |
||||
|
// }) |
||||
|
}, |
||||
|
// 资产代码级联选择框改变事件 |
||||
|
cascaderChange() { |
||||
|
this.$nextTick(() => { |
||||
|
const checkNode = this.$refs.cascaders.getCheckedNodes() |
||||
|
if (checkNode && checkNode[0]) { |
||||
|
this.form.equipmentName = checkNode[0].label |
||||
|
this.form.classCode = checkNode[0].value |
||||
|
} else { |
||||
|
this.form.equipmentName = '' |
||||
|
this.form.classCode = '' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
queryCascaderChange() { |
||||
|
this.$nextTick(() => { |
||||
|
const checkNode = this.$refs.queryCascader.getCheckedNodes() |
||||
|
if (checkNode && checkNode[0]) { |
||||
|
this.query.classCode = checkNode[0].value |
||||
|
} else { |
||||
|
this.query.classCode = '' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 初始化字典相关列表 |
||||
|
initDicDataList() { |
||||
|
// 价值类型列表 |
||||
|
getDicDataListByTypeName('value_type').then(data => { this.valueTypeList = data }) |
||||
|
// 资产来源列表 |
||||
|
getDicDataListByTypeName('asset_source').then(data => { this.assetSourceList = data }) |
||||
|
// 经费来源列表 |
||||
|
getDicDataListByTypeName('funding_source').then(data => { this.fundingSourceList = data }) |
||||
|
// 采购组织形式列表 |
||||
|
getDicDataListByTypeName('procurement_type').then(data => { this.procurementTypeList = data }) |
||||
|
// 折旧状态列表 |
||||
|
getDicDataListByTypeName('depreciation_state').then(data => { this.depreciationStateList = data }) |
||||
|
// 使用状况列表 |
||||
|
getDicDataListByTypeName('use_state').then(data => { this.useStateList = data }) |
||||
|
// 使用方向列表 |
||||
|
getDicDataListByTypeName('use_direction').then(data => { this.useDirectionList = data }) |
||||
|
// 使用用途列表 |
||||
|
getDicDataListByTypeName('use_purpose').then(data => { this.usePurposeList = data }) |
||||
|
// 预警周期列表 |
||||
|
getDicDataListByTypeName('verification_cycle').then(data => { this.cycleList = data }) |
||||
|
}, |
||||
|
// 部门选择回调事件 |
||||
|
getDepartmentValue(value) { |
||||
|
this.form.departmentId = value |
||||
|
}, |
||||
|
// 获取部门树形结构 |
||||
|
getDepartmentTree() { |
||||
|
getDepartmentTreeList().then(data => { |
||||
|
this.departmentTree = data |
||||
|
}) |
||||
|
}, |
||||
|
// 关闭所有弹窗 |
||||
|
resetChecks() { |
||||
|
this.moveDialogVisible = false |
||||
|
}, |
||||
|
// 给检索条件赋值(部门主键) |
||||
|
getDepartmentId(value) { |
||||
|
this.query.departmentId = value === 0 ? '' : value |
||||
|
}, |
||||
|
// 更改行超期、预警字体颜色 |
||||
|
getTableRowClassName({ row }) { |
||||
|
let color = '' |
||||
|
switch (row.ifOverdue) { |
||||
|
case 2: |
||||
|
color = 'table-row-color-red' |
||||
|
break |
||||
|
case 1: |
||||
|
color = 'table-row-color-orange' |
||||
|
break |
||||
|
default: |
||||
|
color = '' |
||||
|
break |
||||
|
} |
||||
|
return color |
||||
|
}, |
||||
|
// 仪器设备领用、借用管理 |
||||
|
moveAdministration(selections) { |
||||
|
if (selections instanceof Array) { |
||||
|
this.moveDialogVisible = true |
||||
|
this.instrumentId = selections[0].id |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.move.init() |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
// 选择计量状态变动 |
||||
|
changeMeasure(val) { |
||||
|
this.ifMeasure = val |
||||
|
}, |
||||
|
// 导出Excel |
||||
|
exportExcel() { |
||||
|
CrudInstrument.exportExcel(this.crud.query).then(data => { |
||||
|
downloadFile(data, parseTime(new Date()) + '-' + this.crud.title + '数据', 'xlsx') |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
input::-webkit-outer-spin-button, |
||||
|
input::-webkit-inner-spin-button { |
||||
|
-webkit-appearance: none !important; |
||||
|
margin: 0; |
||||
|
} |
||||
|
.identification{ |
||||
|
width: 30px; |
||||
|
height:15px; |
||||
|
display: inline-block; |
||||
|
border:gray 1px solid; |
||||
|
border-radius:15px; |
||||
|
float: left; |
||||
|
} |
||||
|
</style> |
@ -1,16 +0,0 @@ |
|||||
<template> |
|
||||
<elFrame :src="oldURL" style="width: 100%" /> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import elFrame from '@/components/Iframe/index' |
|
||||
export default { |
|
||||
name: 'OldProject', |
|
||||
components: { elFrame }, |
|
||||
data() { |
|
||||
return { |
|
||||
oldURL: process.env.VUE_APP_OLD_API + 'user/index' |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
@ -1,427 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button v-show="hasPerm('print:SFD')" type="success" icon="el-icon-printer" @click="printSfd"> |
|
||||
收费通知单 |
|
||||
</el-button> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('YSJL')"> |
|
||||
原始记录 |
|
||||
</el-button> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('JYBG')"> |
|
||||
检验报告 |
|
||||
</el-button> |
|
||||
<!-- <el-button type="primary" icon="el-icon-printer" @click="batchToPrint('HGZ')">--> |
|
||||
<!-- 合格证--> |
|
||||
<!-- </el-button>--> |
|
||||
<el-dropdown @command="printOnline"> |
|
||||
<el-button type="success" icon="el-icon-view"> |
|
||||
预览打印<i class="el-icon-arrow-down el-icon--right" /> |
|
||||
</el-button> |
|
||||
<el-dropdown-menu slot="dropdown"> |
|
||||
<el-dropdown-item command="YSJL"> |
|
||||
原始记录 |
|
||||
</el-dropdown-item> |
|
||||
<el-dropdown-item command="JYBG"> |
|
||||
检验报告 |
|
||||
</el-dropdown-item> |
|
||||
<!-- <el-dropdown-item command="HGZ">--> |
|
||||
<!-- 合格证--> |
|
||||
<!-- </el-dropdown-item>--> |
|
||||
</el-dropdown-menu> |
|
||||
</el-dropdown> |
|
||||
<!-- <el-button type="success" icon="el-icon-edit" @click="editPrintState">--> |
|
||||
<!-- 标记为已打印--> |
|
||||
<!-- </el-button>--> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchYsjl.serialNumber" placeholder="(全部)报检单编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.baogaobianhao" placeholder="报告编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.zhucedaima" placeholder="注册代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdanwei" placeholder="使用单位" clearable style="width: 350px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空 |
|
||||
</el-button> |
|
||||
<br> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdengjibianhao" placeholder="请输入使用登记证编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.chanpinbianhao" placeholder="请输入产品编号" clearable style="width: 185px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanleibie" placeholder="请选择检验类别" style="width: 165px" filterable clearable @change="handleFilter"> |
|
||||
<el-option v-for="item in jylbList" v-show="item.parentId" :key="item.code" :label="item.name" :value="item.code" /> |
|
||||
</el-select> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="请选择下次检验日期" style="width:145px" /> |
|
||||
<span class="radio-group-label">打印状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.printState" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未打印 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已打印 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
@sort-change="sortChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column fixed="left" align="center" label="序号" width="45"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" width="120" sortable="custom" /> |
|
||||
<el-table-column align="center" label="检验类别" prop="jianyanleibie" width="70"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.jianyanleibie === 'DJ'">定期检验</span> |
|
||||
<span v-else-if="scope.row.jianyanleibie === 'JJ'">监督检验</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" :formatter="formatter.formatterCategory" label="检验项目" prop="neibuleibie" width="80" /> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="设备(注册)代码" prop="zhucedaima" width="180" sortable="custom"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.zhucedaima"> |
|
||||
<span v-if="scope.row.zhucedaima.length > 6"> |
|
||||
{{ scope.row.zhucedaima }} |
|
||||
</span> |
|
||||
<span v-else> |
|
||||
{{ scope.row.shebeidaima }} |
|
||||
</span> |
|
||||
</span> |
|
||||
<span v-else> |
|
||||
{{ scope.row.shebeidaima }} |
|
||||
</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" /> |
|
||||
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="110" sortable="custom" /> |
|
||||
<el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" min-width="140" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="100" sortable="custom" /> |
|
||||
<el-table-column align="center" label="交费状态" prop="jfState" width="80" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfState" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" align="center" label="操作" prop="" width="50"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button size="mini" type="primary" icon="el-icon-view" title="预览" circle @click="viewBaogao(scope.row.id, scope.row.reportVersion)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<!-- 高级查询窗口 --> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
|
|
||||
export default { |
|
||||
name: 'PrintReportGlKsWdy', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
order: 'id', // 排序字段 |
|
||||
sort: 'desc', // 排序方式 |
|
||||
hasChild: false, |
|
||||
hasFinish: true, |
|
||||
flowstatus: undefined, |
|
||||
searchYsjl: { |
|
||||
shebeizhongleidaima: '1000', |
|
||||
printState: 0, |
|
||||
jianyanrenyuan: this.$store.getters.userId |
|
||||
} |
|
||||
}, |
|
||||
flowUserList: [], |
|
||||
dialogFormVisible: false, |
|
||||
multipleSelection: [], |
|
||||
multipleSelectionLink: [], |
|
||||
jylbList: [], |
|
||||
userList: [], |
|
||||
printbutton: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.jylbList = this.$store.getters.allCategory |
|
||||
this.userList = this.$store.getters.allUser |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bggl-print-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
async validator(rule, value, callback) { |
|
||||
if (!value) { |
|
||||
callback(new Error(rule.message)) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
}, |
|
||||
getList() { |
|
||||
this.api({ |
|
||||
url: '/ysjl/getList', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
const messagePush = this.$store.getters.messageCount |
|
||||
for (let i = 0; i < messagePush.length; i++) { |
|
||||
if (messagePush[i].key === 'PrintReportGlKsWdy') { |
|
||||
messagePush[i].value = this.totalCount |
|
||||
} |
|
||||
this.$store.state.messageCount = messagePush |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
sortChange(column) { |
|
||||
this.listQuery.order = column.prop |
|
||||
this.listQuery.sort = column.order.replace('ending', '') |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
printOnline(type) { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message('请选择单条进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection.jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
// 查找同单位同年的其他报告 |
|
||||
const id = this.multipleSelection[0].id |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: type, |
|
||||
generateType: false |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: id, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
if (type === 'JYBG') { |
|
||||
this.api({ // 标记为打印状态。 |
|
||||
url: '/ysjl/batchUpdPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: id, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
this.getList() |
|
||||
}) |
|
||||
}, |
|
||||
batchToPrint(type) { |
|
||||
const ysjl = this.multipleSelection[0] |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
let printIds = '' |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
if (type === 'HGZ' && this.multipleSelection[i].jianyanjielun === '不合格') { |
|
||||
this.$message('请选择合格的报告进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection[i].jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
if (this.multipleSelection[i].printCount > 0 && this.multipleSelection[i].jlprintCount > 0) { |
|
||||
printIds += this.multipleSelection[i].id + ',' |
|
||||
} |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
printIds = printIds.substring(0, printIds.length - 1) |
|
||||
} |
|
||||
} |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/getListBanjie', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
pageNum: 1, |
|
||||
pageRow: 20, |
|
||||
searchYsjl: { |
|
||||
baogaobianhao: '(' + new Date().getFullYear() + ')', |
|
||||
shiyongdanwei: ysjl.shiyongdanwei, |
|
||||
jfState: false, |
|
||||
shebeizhongleidaima: '1000' |
|
||||
} |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.$message({ |
|
||||
type: 'warning', |
|
||||
message: '该单位名下存在未收费的检验项!!!' |
|
||||
}) |
|
||||
this.preview({ |
|
||||
url: '/print/createXml', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
if (printIds.length > 0) { |
|
||||
this.api({ // 标记为打印状态。 |
|
||||
url: '/ysjl/batchUpdPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: printIds, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
this.getList() |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchYsjl', { |
|
||||
shebeizhongleidaima: '1000', |
|
||||
printState: 0 |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
printSfd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能打印一份收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].sfdId === null) { |
|
||||
this.$message({ |
|
||||
type: 'warning', |
|
||||
message: '该台设备没有收费通知单!!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].shebeizhongleidaima !== '1000') { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能锅炉打印收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
// 组织数据 |
|
||||
this.apibjd({ |
|
||||
url: '/sfd/getSfdPrintData', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ysjlId: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.info, |
|
||||
paramList: data.paramList, |
|
||||
viewType: 'SFD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
viewBaogao(id, viewType, generateType = false) { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: 'JYBG', |
|
||||
generateType: generateType |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
this.$router.push({ path: '/preview/' + id + '/JYBG/urlPath?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
}) |
|
||||
}, |
|
||||
handleClose() { |
|
||||
// a |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.app-container { |
|
||||
padding-bottom: 0px; |
|
||||
} |
|
||||
</style> |
|
@ -1,476 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('JYBG')"> |
|
||||
批(报告) |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchYsjl.baogaobianhao" placeholder="报告编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.zhucedaima" placeholder="注册代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdanwei" placeholder="使用单位" clearable style="width: 350px" @keyup.enter.native="handleFilter" /> |
|
||||
<br> |
|
||||
<template v-if="notHasRole('GLQYD')"> |
|
||||
<span class="radio-group-label">查看类型:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.createBy" @change="handleFilter"> |
|
||||
<el-radio :label="$store.getters.userId"> |
|
||||
只看创建人 |
|
||||
</el-radio> |
|
||||
<el-radio :label="undefined"> |
|
||||
全部 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
<span class="radio-group-label">打印状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.printState" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未打印 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已打印 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</template> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="highQuery"> |
|
||||
高级查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空条件 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
@sort-change="sortChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column fixed="left" align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column :formatter="formatter.formatterCategory" align="center" label="检验类别" prop="neibuleibie" width="100" /> |
|
||||
<template v-if="$store.getters.departmentId === 74"> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="200" /> |
|
||||
<el-table-column align="center" label="设备代码" prop="shebeidaima" width="200" /> |
|
||||
<el-table-column align="center" label="锅炉型号" prop="guigexinghao" width="200" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="130" /> |
|
||||
</template> |
|
||||
<template v-else> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" width="220" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" /> |
|
||||
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="150" sortable="custom" /> |
|
||||
</template> |
|
||||
<el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" width="140" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="110" sortable="custom" /> |
|
||||
<el-table-column v-if="$store.getters.departmentId !== 74" align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" /> |
|
||||
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="120" /> |
|
||||
<el-table-column align="center" label="打印状态" prop="printState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.printState >= 1" type="success"> |
|
||||
已打印 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="primary"> |
|
||||
未打印 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="交费状态" prop="jfState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfState" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" align="center" label="操作" prop="" width="100"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button size="mini" type="primary" icon="el-icon-view" title="预览" circle @click="common.viewYsjl(scope.row.id, 'JYBG')" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<!-- 高级查询窗口 --> |
|
||||
<el-dialog :visible.sync="dialogQueryVisible" title="高级查询" width="60%"> |
|
||||
<el-container> |
|
||||
<el-form :inline="true"> |
|
||||
<el-form-item label="检验类别:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanleibie" placeholder="请选择检验类别" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in jylbList" v-show="item.parentId" :key="item.code" :label="item.name" :value="item.code" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备种类:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shebeizhongleidaima" placeholder="请选择设备种类" style="width: 165px" filterable clearable> |
|
||||
<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="检验人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanrenyuan" placeholder="请选择检验人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审核人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shenheren" placeholder="请选择审核人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shenpiren" placeholder="请选择审批人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="检验日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.jianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择检验日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审核日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.shenheriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择审核日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.shenpiriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择审批日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="下次检验日期:" style="width: 250px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 145px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="使用登记证编号:" style="width: 350px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdengjibianhao" placeholder="请输入使用登记证编号" clearable style="width: 200px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备/产品名称:" style="width: 290px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.shebeimingcheng" placeholder="请输入设备/产品名称" clearable style="width: 185px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="产品/出厂编号:" style="width: 290px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.chanpinbianhao" placeholder="请输入产品编号" clearable style="width: 185px" /> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</el-container> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button @click="dialogQueryVisible = false"> |
|
||||
取 消 |
|
||||
</el-button> |
|
||||
<el-button type="success" @click="handleFilter"> |
|
||||
查 询 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import Utils from '@/utils/contact' |
|
||||
export default { |
|
||||
name: 'PrintReportGlZj', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
order: 'baogaobianhao', // 排序字段 |
|
||||
sort: 'desc', // 排序方式 |
|
||||
hasChild: false, |
|
||||
hasFinish: true, |
|
||||
flowstatus: undefined, |
|
||||
searchYsjl: { |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
createBy: this.$store.getters.userId, |
|
||||
printState: 0 |
|
||||
} |
|
||||
}, |
|
||||
flowUserList: [], |
|
||||
dialogFormVisible: false, |
|
||||
multipleSelection: [], |
|
||||
multipleSelectionLink: [], |
|
||||
dialogQueryVisible: false, |
|
||||
sbzlList: [], |
|
||||
jylbList: [], |
|
||||
statusList: [ |
|
||||
{ |
|
||||
value: 1, |
|
||||
label: '起草报告' |
|
||||
}, { |
|
||||
value: 2, |
|
||||
label: '审核报告' |
|
||||
}, { |
|
||||
value: 3, |
|
||||
label: '审批报告' |
|
||||
} |
|
||||
], |
|
||||
userList: [], |
|
||||
printbutton: '', |
|
||||
zzdwId: undefined |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
if (this.$store.getters.clientType === 'Enterprise') { |
|
||||
this.api({ |
|
||||
url: '/dwxx/getByUserId', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
userId: this.$store.getters.userId |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.zzdwId = data.zzdwId |
|
||||
this.listQuery.searchYsjl.zzdwId = data.zzdwId |
|
||||
this.listQuery.searchYsjl.departmentId = null |
|
||||
this.listQuery.searchYsjl.createBy = null |
|
||||
this.getList() |
|
||||
}) |
|
||||
} else { |
|
||||
this.getList() |
|
||||
} |
|
||||
this.getSbzlList() |
|
||||
this.jylbList = this.$store.getters.allCategory |
|
||||
this.userList = this.$store.getters.allUser |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bggl-print-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.api({ |
|
||||
url: '/ysjl/getList', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
}) |
|
||||
}, |
|
||||
sortChange(column) { |
|
||||
this.listQuery.order = column.prop |
|
||||
this.listQuery.sort = column.order.replace('ending', '') |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.dialogQueryVisible = false |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
printOnline(type, updateDyState) { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message('请选择单条进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection.jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
const id = this.multipleSelection[0].id |
|
||||
const _vue = this |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: type, |
|
||||
generateType: false |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (type === 'JYBG') { |
|
||||
// 修改打印状态 |
|
||||
this.api({ |
|
||||
url: '/ysjl/updPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
id: id, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
_vue.getList() |
|
||||
Utils.$emit('bggl-print-list') |
|
||||
}) |
|
||||
}, |
|
||||
batchToPrint(type) { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
this.multipleSelection.sort((a, b) => { |
|
||||
return a.baogaobianhao > b.baogaobianhao ? 1 : -1 |
|
||||
}) |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
if (type === 'HGZ' && this.multipleSelection[i].jianyanjielun === '不合格') { |
|
||||
this.$message('请选择合格的报告进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection[i].jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
} |
|
||||
if (type === 'HGZ') { |
|
||||
this.common.viewYsjlNoOpen(ids, type) |
|
||||
} |
|
||||
this.createXml(ids, type) |
|
||||
}, |
|
||||
createXml(ids, type) { |
|
||||
this.preview({ |
|
||||
url: '/print/createXml', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (data === null || data === undefined || data === '') { |
|
||||
this.createXml(ids, type) |
|
||||
return false |
|
||||
} |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
if (type === 'JYBG') { |
|
||||
this.editPrintState(ids) |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
editPrintState(ids) { |
|
||||
this.api({ |
|
||||
url: '/ysjl/batchUpdPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: 'JYBG' |
|
||||
} |
|
||||
}).then((data) => { |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
formatterHuanjie(row) { |
|
||||
switch (row.flowstatus) { |
|
||||
case 1: |
|
||||
return '起草报告' |
|
||||
case 2: |
|
||||
return '审核报告' |
|
||||
case 3: |
|
||||
return '审批报告' |
|
||||
default: |
|
||||
return '未知' |
|
||||
} |
|
||||
}, |
|
||||
highQuery() { |
|
||||
this.dialogQueryVisible = true |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchYsjl', { |
|
||||
departmentId: this.zzdwId ? null : this.$store.getters.departmentId, |
|
||||
createBy: this.zzdwId ? null : this.$store.getters.userId, |
|
||||
zzdwId: this.zzdwId ? this.zzdwId : null, |
|
||||
printState: 0 |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
printSfd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能打印一份收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].sfdId === null) { |
|
||||
this.$message({ |
|
||||
type: 'warning', |
|
||||
message: '该台设备没有收费通知单!!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].shebeizhongleidaima !== '1000') { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能锅炉打印收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
// 组织数据 |
|
||||
this.apibjd({ |
|
||||
url: '/sfd/getSfdPrintData', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ysjlId: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.info, |
|
||||
paramList: data.paramList, |
|
||||
viewType: 'SFD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.app-container { |
|
||||
padding-bottom: 0px; |
|
||||
} |
|
||||
</style> |
|
@ -1,489 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrintPackage"> |
|
||||
客户端批量打印 |
|
||||
</el-button> |
|
||||
<el-button v-show="hasPerm('print:QZJZS')" type="primary" icon="el-icon-printer" @click="batchToPrint('JYBG')"> |
|
||||
批(报告) |
|
||||
</el-button> |
|
||||
<el-button v-show="hasPerm('print:QZJZS')" type="success" icon="el-icon-edit" @click="editPrintState"> |
|
||||
标记为已打印 |
|
||||
</el-button> |
|
||||
<el-button v-show="listQuery.searchYsjl.departmentId === 77" type="primary" @click="openGrant()"> |
|
||||
<svg-icon icon-class="form" /> |
|
||||
报告发放 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchYsjl.sfdSerialNumber" placeholder="(全部)收费单编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input |
|
||||
v-model="listQuery.searchYsjl.baogaobianhao" |
|
||||
placeholder="报告编号" |
|
||||
clearable |
|
||||
style="width: 200px" |
|
||||
@keyup.enter.native="handleFilter" |
|
||||
/> |
|
||||
<el-input |
|
||||
v-model="listQuery.searchYsjl.chanpinbianhao" |
|
||||
placeholder="产品编号" |
|
||||
clearable |
|
||||
style="width: 185px" |
|
||||
@keyup.enter.native="handleFilter" |
|
||||
/> |
|
||||
<el-input |
|
||||
v-show="ifZhizaodanwei" |
|
||||
v-model="listQuery.searchYsjl.zhizaodanwei" |
|
||||
placeholder="制造单位" |
|
||||
clearable |
|
||||
style="width: 350px" |
|
||||
@keyup.enter.native="handleFilter" |
|
||||
/> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空 |
|
||||
</el-button> |
|
||||
<br> |
|
||||
<span v-show="hasPerm('print:QZJZS')"> |
|
||||
<span class="radio-group-label">打印状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.printState" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未打印 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已打印 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</span> |
|
||||
|
|
||||
<span v-show="listQuery.searchYsjl.departmentId === 77"> |
|
||||
<span class="radio-group-label">发放状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.fafangState" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未发放 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已发放 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</span> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
@sort-change="sortChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column fixed="left" align="center" label="序号" type="index" width="60" /> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" width="220" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" /> |
|
||||
<el-table-column |
|
||||
:formatter="formatter.getChineseName" |
|
||||
align="center" |
|
||||
label="检验人员" |
|
||||
prop="jianyanrenyuan" |
|
||||
width="140" |
|
||||
/> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="110" sortable="custom" /> |
|
||||
<el-table-column align="center" label="打印状态" prop="printState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.printState" type="success"> |
|
||||
已打印 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未打印 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="交费状态" prop="jfState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfState" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" align="center" label="操作" prop="" width="100"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button |
|
||||
size="mini" |
|
||||
type="primary" |
|
||||
icon="el-icon-view" |
|
||||
title="预览" |
|
||||
circle |
|
||||
@click="viewBaogao(scope.row.id, scope.row.reportVersion)" |
|
||||
/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination |
|
||||
v-show="totalCount>0" |
|
||||
:total="totalCount" |
|
||||
:page-num.sync="listQuery.pageNum" |
|
||||
:page-row.sync="listQuery.pageRow" |
|
||||
@pagination="getList" |
|
||||
/> |
|
||||
<sign-info v-if="fafangVisible" :fafanglisttable="multipleSelection" @closeFafang="fafangVisible = false" @refulshList="handleFilter" /> |
|
||||
<!-- 高级查询窗口 --> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import { getNeedRecordList } from '@/api/ysjl' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import SignInfo from '../sign_info' |
|
||||
|
|
||||
export default { |
|
||||
name: 'PrintReportYlrqZj', |
|
||||
components: { Sticky, Pagination, SignInfo }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
order: 'id', // 排序字段 |
|
||||
sort: 'desc', // 排序方式 |
|
||||
searchYsjl: { |
|
||||
bglx: 1, |
|
||||
zfState: false, |
|
||||
jianyanleibie: 'ZJ', |
|
||||
flowstatus: 4, |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
shebeizhongleidaima: 2000, |
|
||||
jianyanrenyuan: this.$store.getters.clientType === 'System' && this.$store.getters.username !== 'admin' && this.$store.getters.departmentId === 84 ? this.$store.getters.userId : '', |
|
||||
zhizaodanwei: this.$store.getters.clientType === 'Enterprise' ? this.$store.getters.nickname : '', |
|
||||
fafangState: this.$store.getters.departmentId === 84 ? undefined : 0, |
|
||||
printState: 0 |
|
||||
} |
|
||||
}, |
|
||||
flowUserList: [], |
|
||||
ifZhizaodanwei: this.$store.getters.clientType === 'System', |
|
||||
dialogFormVisible: false, |
|
||||
multipleSelection: [], |
|
||||
multipleSelectionLink: [], |
|
||||
sbzlList: [], |
|
||||
jylbList: [], |
|
||||
userList: [], |
|
||||
printbutton: '', |
|
||||
fafangVisible: false |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
this.jylbList = this.$store.getters.allCategory |
|
||||
this.userList = this.$store.getters.allUser |
|
||||
if (this.listQuery.searchYsjl.departmentId === 77) { |
|
||||
this.listQuery.searchYsjl.printState = null |
|
||||
} |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('print-report-ylrq-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
/** |
|
||||
* 批量打印完整包 |
|
||||
*/ |
|
||||
batchToPrintPackage() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
this.multipleSelection.forEach(obj => { |
|
||||
if (ids === '') { |
|
||||
ids = obj.id |
|
||||
} else { |
|
||||
ids = ids + ',' + obj.id |
|
||||
} |
|
||||
}) |
|
||||
this.preview({ |
|
||||
url: '/print/createXmlPackage', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: '' |
|
||||
} |
|
||||
}).then(() => { |
|
||||
this.handleFilter() |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
async validator(rule, value, callback) { |
|
||||
if (!value) { |
|
||||
callback(new Error(rule.message)) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
}, |
|
||||
getList() { |
|
||||
getNeedRecordList(this.listQuery).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
}) |
|
||||
}, |
|
||||
sortChange(column) { |
|
||||
this.listQuery.order = column.prop |
|
||||
this.listQuery.sort = column.order.replace('ending', '') |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
printOnline(type) { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message('请选择单条进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
if (type === 'PARAM' && this.multipleSelection[0].shebeileibiedaima === '2300') { |
|
||||
this.$message('该报告没有数据表!') |
|
||||
return false |
|
||||
} |
|
||||
if (type === 'BATCH_PROOF' && this.multipleSelection[0].shebeileibiedaima === '2100') { |
|
||||
this.$message('该报告没有批量证明!') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection.jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
const id = this.multipleSelection[0].id |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: type, |
|
||||
generateType: false |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: id, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
batchToPrint(type) { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
if (type === 'HGZ' && this.multipleSelection[i].jianyanjielun === '不合格') { |
|
||||
this.$message('请选择合格的报告进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection[i].jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
} |
|
||||
this.preview({ |
|
||||
url: '/print/createXml', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchYsjl', { |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
createBy: this.$store.getters.userId, |
|
||||
printState: 0 |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
editPrintState() { |
|
||||
// 标记为已打印 |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行操作。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
if (this.multipleSelection[i].reportVersion !== this.multipleSelection[0].reportVersion) { |
|
||||
this.$message('请选择报告版本是同版本的报告进行操作。') |
|
||||
return false |
|
||||
} |
|
||||
} |
|
||||
this.api({ |
|
||||
url: '/ysjl/batchUpdPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: 'JYBG' |
|
||||
} |
|
||||
}).then((data) => { |
|
||||
if (data.returnCode === '100') { |
|
||||
this.$message.success('修改成功!') |
|
||||
} else { |
|
||||
this.$message.error('修改失败!') |
|
||||
} |
|
||||
this.getList() |
|
||||
}) |
|
||||
}, |
|
||||
printSfd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能打印一份收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].sfdId === null) { |
|
||||
this.$message({ |
|
||||
type: 'warning', |
|
||||
message: '该台设备没有收费通知单!!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].shebeizhongleidaima !== '1000') { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能锅炉打印收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
// 组织数据 |
|
||||
this.apibjd({ |
|
||||
url: '/sfd/getSfdPrintData', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ysjlId: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.info, |
|
||||
paramList: data.paramList, |
|
||||
viewType: 'SFD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
openGrant() { |
|
||||
if (this.multipleSelection.length <= 0) { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '请先选择需要发放的报告!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
this.fafangVisible = true |
|
||||
}, |
|
||||
viewBaogao(id, viewType, generateType = false) { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: 'JYBG', |
|
||||
generateType: generateType |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
this.$router.push({ path: '/preview/' + id + '/JYBG/urlPath?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.app-container { |
|
||||
padding-bottom: 0px; |
|
||||
} |
|
||||
</style> |
|
@ -1,339 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('YSJL')"> |
|
||||
原始记录 |
|
||||
</el-button> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('JYBG')"> |
|
||||
检验报告 |
|
||||
</el-button> |
|
||||
<el-button type="primary" @click="openGrant()"> |
|
||||
<svg-icon icon-class="form" /> |
|
||||
报告发放 |
|
||||
</el-button> |
|
||||
<el-dropdown @command="printOnline"> |
|
||||
<el-button type="success" icon="el-icon-view"> |
|
||||
预览打印<i class="el-icon-arrow-down el-icon--right" /> |
|
||||
</el-button> |
|
||||
<el-dropdown-menu slot="dropdown"> |
|
||||
<el-dropdown-item command="YSJL"> |
|
||||
原始记录 |
|
||||
</el-dropdown-item> |
|
||||
<el-dropdown-item command="JYBG"> |
|
||||
检验报告 |
|
||||
</el-dropdown-item> |
|
||||
</el-dropdown-menu> |
|
||||
</el-dropdown> |
|
||||
<!-- <el-button type="success" icon="el-icon-edit" @click="editPrintState">--> |
|
||||
<!-- 标记为已打印--> |
|
||||
<!-- </el-button>--> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchYsjl.serialNumber" placeholder="(全部)报检单编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.baogaobianhao" placeholder="报告编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.zhucedaima" placeholder="注册代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdanwei" placeholder="使用单位" clearable style="width: 350px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空 |
|
||||
</el-button> |
|
||||
<br> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdengjibianhao" placeholder="请输入使用登记证编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.chanpinbianhao" placeholder="请输入产品编号" clearable style="width: 185px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanleibie" placeholder="请选择检验类别" style="width: 165px" filterable clearable @change="handleFilter"> |
|
||||
<el-option v-for="item in jylbList" v-show="item.parentId" :key="item.code" :label="item.name" :value="item.code" /> |
|
||||
</el-select> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="请选择下次检验日期" style="width:145px" /> |
|
||||
<span class="radio-group-label">发放状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.fafangState" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未发放 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已发放 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
@sort-change="sortChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column fixed="left" align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="检验类别" prop="jianyanleibie" width="80"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.jianyanleibie === 'DJ'">定期检验</span> |
|
||||
<span v-else-if="scope.row.jianyanleibie === 'JJ'">监督检验</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" /> |
|
||||
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="150" sortable="custom" /> |
|
||||
<el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" width="140" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyankaishiriqi" width="110" sortable="custom" /> |
|
||||
<el-table-column align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" /> |
|
||||
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="80" /> |
|
||||
<el-table-column align="center" label="打印状态" prop="printState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.printState" type="success"> |
|
||||
已打印 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未打印 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="交费状态" prop="jfState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfState" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" align="center" label="操作" prop="" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button size="mini" type="primary" icon="el-icon-view" title="预览" circle @click="viewBaogao(scope.row.id, scope.row.reportVersion)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<sign-info v-if="fafangVisible" :fafanglisttable="multipleSelection" @closeFafang="fafangVisible = false" @refulshList="handleFilter" /> |
|
||||
<!-- 高级查询窗口 --> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import SignInfo from '../sign_info' |
|
||||
|
|
||||
export default { |
|
||||
name: 'PrintReportAQFWdy', |
|
||||
components: { Sticky, Pagination, SignInfo }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
order: 'id', // 排序字段 |
|
||||
sort: 'desc', // 排序方式 |
|
||||
hasChild: false, |
|
||||
hasFinish: true, |
|
||||
flowstatus: undefined, |
|
||||
searchYsjl: { |
|
||||
shebeizhongleidaima: 'F000', |
|
||||
fafangState: 0 |
|
||||
} |
|
||||
}, |
|
||||
flowUserList: [], |
|
||||
fafangVisible: false, |
|
||||
dialogFormVisible: false, |
|
||||
multipleSelection: [], |
|
||||
multipleSelectionLink: [], |
|
||||
jylbList: [], |
|
||||
userList: [], |
|
||||
printbutton: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.jylbList = this.$store.getters.allCategory |
|
||||
this.userList = this.$store.getters.allUser |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bggl-print-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
async validator(rule, value, callback) { |
|
||||
if (!value) { |
|
||||
callback(new Error(rule.message)) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
}, |
|
||||
getList() { |
|
||||
this.api({ |
|
||||
url: '/ysjl/getList', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
}) |
|
||||
}, |
|
||||
sortChange(column) { |
|
||||
this.listQuery.order = column.prop |
|
||||
this.listQuery.sort = column.order.replace('ending', '') |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
printOnline(type, updateDyState) { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message('请选择单条进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection.jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
const id = this.multipleSelection[0].id |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: type, |
|
||||
generateType: false |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
id: id, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
batchToPrint(type) { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
if (type === 'HGZ' && this.multipleSelection[i].jianyanjielun === '不合格') { |
|
||||
this.$message('请选择合格的报告进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection[i].jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
} |
|
||||
this.preview({ |
|
||||
url: '/print/createXml', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
this.api({ // 记录打印详细,不做打印状态改变。 |
|
||||
url: '/ysjl/batchRecordPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
if (type === 'JYBG') { |
|
||||
this.api({ // 标记为打印状态。 |
|
||||
url: '/ysjl/batchUpdPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchYsjl', { |
|
||||
shebeizhongleidaima: '7000', |
|
||||
printState: 0 |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
viewBaogao(id, viewType, generateType = false) { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: 'JYBG', |
|
||||
generateType: generateType |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
this.$router.push({ path: '/preview/' + id + '/JYBG/urlPath?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data) + '&v=' + Math.random() }) |
|
||||
}) |
|
||||
}, |
|
||||
openGrant() { |
|
||||
if (this.multipleSelection.length <= 0) { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '请先选择需要发放的报告!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
this.fafangVisible = true |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.app-container { |
|
||||
padding-bottom: 0px; |
|
||||
} |
|
||||
</style> |
|
@ -1,495 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<!--<el-button type="success" icon="el-icon-printer" @click="printSfd"> |
|
||||
收费通知单 |
|
||||
</el-button>--> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('JYBG')"> |
|
||||
批(报告) |
|
||||
</el-button> |
|
||||
<el-button v-if="notHasDepartmentId(74)" type="primary" icon="el-icon-printer" @click="batchToPrint('HGZ')"> |
|
||||
批(合格证) |
|
||||
</el-button> |
|
||||
<el-dropdown @command="printOnline"> |
|
||||
<el-button type="success" icon="el-icon-printer"> |
|
||||
预览打印<i class="el-icon-arrow-down el-icon--right" /> |
|
||||
</el-button> |
|
||||
<el-dropdown-menu slot="dropdown"> |
|
||||
<el-dropdown-item command="JYBG"> |
|
||||
打印报告 |
|
||||
</el-dropdown-item> |
|
||||
<el-dropdown-item v-if="notHasDepartmentId(74)" command="HGZ"> |
|
||||
打印合格证 |
|
||||
</el-dropdown-item> |
|
||||
</el-dropdown-menu> |
|
||||
</el-dropdown> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchYsjl.baogaobianhao" placeholder="报告编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.zhucedaima" placeholder="注册代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdanwei" placeholder="使用单位" clearable style="width: 350px" @keyup.enter.native="handleFilter" /> |
|
||||
<br> |
|
||||
<template v-show="$store.getters.clientType !== 'Enterprise'"> |
|
||||
<span class="radio-group-label">查看类型:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.createBy" @change="handleFilter"> |
|
||||
<el-radio :label="$store.getters.userId"> |
|
||||
只看创建人 |
|
||||
</el-radio> |
|
||||
<el-radio :label="undefined"> |
|
||||
全部 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
</template> |
|
||||
<span class="radio-group-label">打印状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.printState" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未打印 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已打印 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="highQuery"> |
|
||||
高级查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空条件 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
@sort-change="sortChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column fixed="left" align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="报告编号" prop="baogaobianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column :formatter="formatter.formatterCategory" align="center" label="检验类别" prop="neibuleibie" width="100" /> |
|
||||
<template v-if="$store.getters.departmentId === 74"> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="200" /> |
|
||||
<el-table-column align="center" label="设备代码" prop="shebeidaima" width="200" /> |
|
||||
<el-table-column align="center" label="锅炉型号" prop="guigexinghao" width="200" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="130" /> |
|
||||
</template> |
|
||||
<template v-else> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" width="220" /> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" /> |
|
||||
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="150" sortable="custom" /> |
|
||||
</template> |
|
||||
<el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" width="140" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="110" sortable="custom" /> |
|
||||
<el-table-column v-if="$store.getters.departmentId !== 74" align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" /> |
|
||||
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="120" /> |
|
||||
<el-table-column align="center" label="打印状态" prop="printState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.printState >= 1" type="success"> |
|
||||
已打印 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="primary"> |
|
||||
未打印 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="交费状态" prop="jfState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfState" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" align="center" label="操作" prop="" width="100"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button size="mini" type="primary" icon="el-icon-view" title="预览" circle @click="common.viewYsjl(scope.row.id, 'JYBG')" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<!-- 高级查询窗口 --> |
|
||||
<el-dialog :visible.sync="dialogQueryVisible" title="高级查询" width="60%"> |
|
||||
<el-container> |
|
||||
<el-form :inline="true"> |
|
||||
<el-form-item label="检验类别:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanleibie" placeholder="请选择检验类别" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in jylbList" v-show="item.parentId" :key="item.code" :label="item.name" :value="item.code" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备种类:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shebeizhongleidaima" placeholder="请选择设备种类" style="width: 165px" filterable clearable> |
|
||||
<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="检验人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanrenyuan" placeholder="请选择检验人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审核人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shenheren" placeholder="请选择审核人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shenpiren" placeholder="请选择审批人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="检验日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.jianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择检验日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审核日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.shenheriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择审核日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.shenpiriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择审批日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="下次检验日期:" style="width: 250px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 145px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="使用登记证编号:" style="width: 350px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdengjibianhao" placeholder="请输入使用登记证编号" clearable style="width: 200px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备/产品名称:" style="width: 290px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.shebeimingcheng" placeholder="请输入设备/产品名称" clearable style="width: 185px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="产品/出厂编号:" style="width: 290px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.chanpinbianhao" placeholder="请输入产品编号" clearable style="width: 185px" /> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</el-container> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button @click="dialogQueryVisible = false"> |
|
||||
取 消 |
|
||||
</el-button> |
|
||||
<el-button type="success" @click="handleFilter"> |
|
||||
查 询 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import Utils from '../../utils/contact.js' |
|
||||
export default { |
|
||||
name: 'PrintReport', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
order: 'baogaobianhao', // 排序字段 |
|
||||
sort: 'desc', // 排序方式 |
|
||||
hasChild: false, |
|
||||
hasFinish: true, |
|
||||
flowstatus: undefined, |
|
||||
searchYsjl: { |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
createBy: this.$store.getters.departmentId === 70 ? this.$store.getters.userId : undefined, |
|
||||
printState: 0 |
|
||||
} |
|
||||
}, |
|
||||
flowUserList: [], |
|
||||
dialogFormVisible: false, |
|
||||
multipleSelection: [], |
|
||||
multipleSelectionLink: [], |
|
||||
dialogQueryVisible: false, |
|
||||
sbzlList: [], |
|
||||
jylbList: [], |
|
||||
statusList: [ |
|
||||
{ |
|
||||
value: 1, |
|
||||
label: '起草报告' |
|
||||
}, { |
|
||||
value: 2, |
|
||||
label: '审核报告' |
|
||||
}, { |
|
||||
value: 3, |
|
||||
label: '审批报告' |
|
||||
} |
|
||||
], |
|
||||
userList: [], |
|
||||
printbutton: '', |
|
||||
zzdwId: undefined |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
if (this.$store.getters.clientType === 'Enterprise') { |
|
||||
this.api({ |
|
||||
url: '/dwxx/getByUserId', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
userId: this.$store.getters.userId |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.zzdwId = data.zzdwId |
|
||||
this.listQuery.searchYsjl.zzdwId = data.zzdwId |
|
||||
this.listQuery.searchYsjl.departmentId = null |
|
||||
this.listQuery.searchYsjl.createBy = null |
|
||||
this.getList() |
|
||||
}) |
|
||||
} else { |
|
||||
this.getList() |
|
||||
} |
|
||||
this.getSbzlList() |
|
||||
this.jylbList = this.$store.getters.allCategory |
|
||||
this.userList = this.$store.getters.allUser |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('bggl-print-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.api({ |
|
||||
url: '/ysjl/getList', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
}) |
|
||||
}, |
|
||||
sortChange(column) { |
|
||||
this.listQuery.order = column.prop |
|
||||
this.listQuery.sort = column.order.replace('ending', '') |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.dialogQueryVisible = false |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
printOnline(type, updateDyState) { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message('请选择单条进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection.jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
const id = this.multipleSelection[0].id |
|
||||
const _vue = this |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: type, |
|
||||
generateType: false |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (type === 'JYBG') { |
|
||||
// 修改打印状态 |
|
||||
this.api({ |
|
||||
url: '/ysjl/updPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
id: id, |
|
||||
type: type |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
_vue.getList() |
|
||||
Utils.$emit('bggl-print-list') |
|
||||
}) |
|
||||
}, |
|
||||
batchToPrint(type) { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
this.multipleSelection.sort((a, b) => { |
|
||||
return a.baogaobianhao > b.baogaobianhao ? 1 : -1 |
|
||||
}) |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
if (type === 'HGZ' && this.multipleSelection[i].jianyanjielun === '不合格') { |
|
||||
this.$message('请选择合格的报告进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection[i].jfState) { |
|
||||
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
} |
|
||||
if (type === 'HGZ') { |
|
||||
this.common.viewYsjlNoOpen(ids, type) |
|
||||
} |
|
||||
this.createXml(ids, type) |
|
||||
}, |
|
||||
createXml(ids, type) { |
|
||||
this.preview({ |
|
||||
url: '/print/createXml', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}).then(data => { |
|
||||
if (data === null || data === undefined || data === '') { |
|
||||
this.createXml(ids, type) |
|
||||
return false |
|
||||
} |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
if (type === 'JYBG') { |
|
||||
this.editPrintState(ids) |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
editPrintState(ids) { |
|
||||
this.api({ |
|
||||
url: '/ysjl/batchUpdPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: 'JYBG' |
|
||||
} |
|
||||
}).then((data) => { |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
formatterHuanjie(row) { |
|
||||
switch (row.flowstatus) { |
|
||||
case 1: |
|
||||
return '起草报告' |
|
||||
case 2: |
|
||||
return '审核报告' |
|
||||
case 3: |
|
||||
return '审批报告' |
|
||||
default: |
|
||||
return '未知' |
|
||||
} |
|
||||
}, |
|
||||
highQuery() { |
|
||||
this.dialogQueryVisible = true |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchYsjl', { |
|
||||
departmentId: this.zzdwId ? null : this.$store.getters.departmentId, |
|
||||
createBy: this.zzdwId ? null : this.$store.getters.userId, |
|
||||
zzdwId: this.zzdwId ? this.zzdwId : null, |
|
||||
printState: 0 |
|
||||
}) |
|
||||
this.getList() |
|
||||
}, |
|
||||
printSfd() { |
|
||||
if (this.multipleSelection.length > 1) { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能打印一份收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].sfdId === null) { |
|
||||
this.$message({ |
|
||||
type: 'warning', |
|
||||
message: '该台设备没有收费通知单!!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.multipleSelection[0].shebeizhongleidaima !== '1000') { |
|
||||
this.$message({ |
|
||||
type: 'info', |
|
||||
message: '只能锅炉打印收费通知单!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
// 组织数据 |
|
||||
this.apibjd({ |
|
||||
url: '/sfd/getSfdPrintData', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ysjlId: this.multipleSelection[0].id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.preview({ |
|
||||
url: '/print/generatePdfListing', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
info: data.info, |
|
||||
paramList: data.paramList, |
|
||||
viewType: 'SFD' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.app-container { |
|
||||
padding-bottom: 0px; |
|
||||
} |
|
||||
</style> |
|
@ -1,354 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('YSJL')"> |
|
||||
批量打印 |
|
||||
</el-button> |
|
||||
<el-button type="success" icon="el-icon-printer" @click="printOnline"> |
|
||||
预览打印 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-input v-model="listQuery.searchYsjl.jilubianhao" placeholder="记录编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.zhucedaima" placeholder="注册代码" clearable style="width: 240px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdanwei" placeholder="使用单位" clearable style="width: 400px" @keyup.enter.native="handleFilter" /> |
|
||||
<br> |
|
||||
<span class="radio-group-label">查看类型:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.createBy" @change="handleFilter"> |
|
||||
<el-radio :label="$store.getters.userId"> |
|
||||
只看创建人 |
|
||||
</el-radio> |
|
||||
<el-radio :label="undefined"> |
|
||||
全部 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
<span class="radio-group-label">打印状态:</span> |
|
||||
<el-radio-group v-model="listQuery.searchYsjl.jlprintCount" @change="handleFilter"> |
|
||||
<el-radio :label="0"> |
|
||||
未打印 |
|
||||
</el-radio> |
|
||||
<el-radio :label="1"> |
|
||||
已打印 |
|
||||
</el-radio> |
|
||||
</el-radio-group> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="highQuery"> |
|
||||
高级查询 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery"> |
|
||||
清空条件 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
width="100%" |
|
||||
size="small" |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
@sort-change="sortChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column fixed="left" align="center" label="序号" width="60"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-text="getIndex(scope.$index)" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="记录编号" prop="jilubianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column :formatter="formatter.formatterCategory" align="center" label="检验类别" prop="neibuleibie" width="100" /> |
|
||||
<template v-if="$store.getters.departmentId === 74"> |
|
||||
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="200" /> |
|
||||
<el-table-column align="center" label="设备代码" prop="shebeidaima" width="200" /> |
|
||||
<el-table-column align="center" label="锅炉型号" prop="guigexinghao" width="200" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="130" /> |
|
||||
</template> |
|
||||
<template v-else> |
|
||||
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" /> |
|
||||
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" /> |
|
||||
<el-table-column align="center" label="产品名称/设备名称" prop="shebeimingcheng" width="220" /> |
|
||||
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" /> |
|
||||
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="150" sortable="custom" /> |
|
||||
</template> |
|
||||
<el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" width="140" /> |
|
||||
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="110" sortable="custom" /> |
|
||||
<el-table-column v-if="$store.getters.departmentId !== 74" align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" /> |
|
||||
<el-table-column align="center" label="打印状态" prop="jlprintCount" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jlprintCount >= 1" type="success"> |
|
||||
已打印 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="primary"> |
|
||||
未打印 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" label="交费状态" prop="jfState" width="90" fixed="right"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-tag v-if="scope.row.jfState" type="success"> |
|
||||
已交费 |
|
||||
</el-tag> |
|
||||
<el-tag v-else type="danger"> |
|
||||
未交费 |
|
||||
</el-tag> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" align="center" label="操作" prop="" width="120"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button v-if="scope.row.shebeizhongleidaima === '2000' && scope.row.jianyanleibie === 'ZJ'" size="mini" type="primary" icon="el-icon-view" title="预览原始记录" circle @click="common.viewYsjl(scope.row.id, 'IMPORT')" /> |
|
||||
<el-button v-else size="mini" type="primary" icon="el-icon-view" title="预览" circle @click="common.viewYsjl(scope.row.id, 'YSJL')" /> |
|
||||
<el-button v-show="scope.row.shebeileibiedaima === '2100' && scope.row.jianyanleibie === 'ZJ'" size="mini" type="success" icon="el-icon-view" title="预览数据表" circle @click="common.viewYsjl(scope.row.id, 'PARAM')" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" /> |
|
||||
<!-- 高级查询窗口 --> |
|
||||
<el-dialog :visible.sync="dialogQueryVisible" title="高级查询" width="60%"> |
|
||||
<el-container> |
|
||||
<el-form :inline="true"> |
|
||||
<el-form-item label="检验类别:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanleibie" placeholder="请选择检验类别" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in jylbList" v-show="item.parentId" :key="item.code" :label="item.name" :value="item.code" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备种类:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shebeizhongleidaima" placeholder="请选择设备种类" style="width: 165px" filterable clearable> |
|
||||
<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="检验人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.jianyanrenyuan" placeholder="请选择检验人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="校核人员:" style="width: 240px;"> |
|
||||
<el-select v-model="listQuery.searchYsjl.shenheren" placeholder="请选择审核人员" style="width: 165px" filterable clearable> |
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="检验日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.jianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择检验日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审核日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.shenheriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择审核日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批日期:" style="width: 240px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.shenpiriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择审批日期" style="width: 165px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="下次检验日期:" style="width: 250px;"> |
|
||||
<el-date-picker v-model="listQuery.searchYsjl.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 145px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="使用登记证编号:" style="width: 350px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.shiyongdengjibianhao" placeholder="请输入使用登记证编号" clearable style="width: 200px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备/产品名称:" style="width: 290px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.shebeimingcheng" placeholder="请输入设备/产品名称" clearable style="width: 185px" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="产品/出厂编号:" style="width: 290px;"> |
|
||||
<el-input v-model="listQuery.searchYsjl.chanpinbianhao" placeholder="请输入产品编号" clearable style="width: 185px" /> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</el-container> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button @click="dialogQueryVisible = false"> |
|
||||
取 消 |
|
||||
</el-button> |
|
||||
<el-button type="success" @click="handleFilter"> |
|
||||
查 询 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import Utils from '../../utils/contact.js' |
|
||||
import preview from '../../utils/preview.js' |
|
||||
export default { |
|
||||
name: 'HasDonePrintYsjl', |
|
||||
components: { Sticky, Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
totalCount: 0, |
|
||||
list: [], |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageRow: 20, // 每页条数 |
|
||||
order: 'jilubianhao', // 排序字段 |
|
||||
sort: 'desc', // 排序方式 |
|
||||
searchYsjl: { |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
createBy: this.$store.getters.departmentId === 70 ? this.$store.getters.userId : undefined, |
|
||||
jlprintCount: 0 |
|
||||
}, |
|
||||
hasChild: false, |
|
||||
hasFinish: true |
|
||||
}, |
|
||||
multipleSelection: [], |
|
||||
userList: [], |
|
||||
sbzlList: [], |
|
||||
printbutton: '', |
|
||||
dialogQueryVisible: false |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
this.jylbList = this.$store.getters.allCategory |
|
||||
this.userList = this.$store.getters.allUser |
|
||||
}, |
|
||||
mounted() { |
|
||||
const that = this |
|
||||
this.common.$on('ysjl-yb-list', function() { |
|
||||
that.handleFilter() |
|
||||
}) |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.api({ |
|
||||
url: '/ysjl/getList', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.totalCount = data.totalCount |
|
||||
}) |
|
||||
}, |
|
||||
sortChange(column) { |
|
||||
this.listQuery.order = column.prop |
|
||||
this.listQuery.sort = column.order.replace('ending', '') |
|
||||
this.getList() |
|
||||
}, |
|
||||
getIndex($index) { |
|
||||
// 表格序号 |
|
||||
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
batchToPrint(type) { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message('请选择单条或者多条设备进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
let ids = '' |
|
||||
this.multipleSelection.sort((a, b) => { |
|
||||
return a.jilubianhao > b.jilubianhao ? 1 : -1 |
|
||||
}) |
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|
||||
ids += this.multipleSelection[i].id + ',' |
|
||||
if (i + 1 === this.multipleSelection.length) { |
|
||||
ids = ids.substring(0, ids.length - 1) |
|
||||
} |
|
||||
// if (!this.multipleSelection[i].jfState) { |
|
||||
// this.$message.error('存在未收费的记录,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
} |
|
||||
this.preview({ |
|
||||
url: '/print/createXml', |
|
||||
method: 'post', |
|
||||
params: { |
|
||||
ids: ids, |
|
||||
type: type |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.printbutton = 'ReportPrintApp://' + data |
|
||||
}) |
|
||||
}, |
|
||||
printOnline() { |
|
||||
if (this.multipleSelection.length !== 1) { |
|
||||
this.$message('请选择单条进行打印。') |
|
||||
return false |
|
||||
} |
|
||||
// if (!this.multipleSelection.jfState) { |
|
||||
// this.$message.error('存在未收费的记录,请联系收费核实后再进行打印。') |
|
||||
// return false |
|
||||
// } |
|
||||
const id = this.multipleSelection[0].id |
|
||||
let viewType = 'YSJL' |
|
||||
if (this.multipleSelection[0].jianyanleibie === 'ZJ' && this.multipleSelection[0].shebeizhongleidaima === '2000') { |
|
||||
viewType = 'IMPORT' |
|
||||
} |
|
||||
const _vue = this |
|
||||
preview({ |
|
||||
url: '/print/generatePdf', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
ysjlId: id, |
|
||||
viewType: viewType, |
|
||||
generateType: false |
|
||||
} |
|
||||
}).then(data => { |
|
||||
// 修改打印状态 |
|
||||
this.api({ |
|
||||
url: '/ysjl/updPrintState', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
id: id, |
|
||||
type: 'ysjl' |
|
||||
} |
|
||||
}) |
|
||||
data = data.replace(/\\/g, '/') |
|
||||
window.open(data) |
|
||||
_vue.getList() |
|
||||
Utils.$emit('ysjl-print-list') |
|
||||
}) |
|
||||
}, |
|
||||
highQuery() { |
|
||||
this.dialogQueryVisible = true |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
clearQuery() { |
|
||||
this.$set(this.listQuery, 'searchYsjl', { |
|
||||
departmentId: this.$store.getters.departmentId, |
|
||||
createBy: this.$store.getters.userId, |
|
||||
jlprintCount: 0 |
|
||||
}) |
|
||||
this.getList() |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.app-container { |
|
||||
padding-bottom: 0px; |
|
||||
} |
|
||||
</style> |
|
Loading…
Reference in new issue