Browse Source

提交代码,部分报错仍待解决

master
xiaobai 3 years ago
parent
commit
4693f10677
  1. 97
      src/api/common.js
  2. 9
      src/api/data.js
  3. 40
      src/api/dic_data.js
  4. 46
      src/api/instrument.js
  5. 31
      src/api/instrument_move.js
  6. 52
      src/api/role.js
  7. 70
      src/components/Crud/Delete/index.vue
  8. 21
      src/components/Crud/Edit/index.vue
  9. 20
      src/components/Crud/Pagination/index.vue
  10. 17
      src/components/Crud/Query/index.vue
  11. 115
      src/components/Crud/Table/index.vue
  12. 740
      src/components/Crud/crud.js
  13. 167
      src/components/Crud/index.vue
  14. 169
      src/components/TreeSelect/index.vue
  15. 111
      src/components/drawerDialog/index.vue
  16. 124
      src/components/subTable/index.vue
  17. 306
      src/views/allot/old_list.vue
  18. 29
      src/views/allot/team_list.vue
  19. 150
      src/views/allot/zuofei_list.vue
  20. 150
      src/views/base/list.vue
  21. 13
      src/views/bjd/department_list.vue
  22. 9
      src/views/bjd/dj_input.vue
  23. 7
      src/views/bjd/jj_input.vue
  24. 525
      src/views/bjd/wx_list.vue
  25. 7
      src/views/bjd/zj_input.vue
  26. 362
      src/views/bjd/zj_list.vue
  27. 444
      src/views/bjd/zlsc_list.vue
  28. 509
      src/views/bjd/zlsc_list_all.vue
  29. 316
      src/views/device_management/components/Move.vue
  30. 557
      src/views/device_management/index.vue
  31. 53
      src/views/dic/category.vue
  32. 415
      src/views/dic/dic_type.vue
  33. 16
      src/views/preview/old_project.vue
  34. 427
      src/views/print/1000/print_list_depar.vue
  35. 476
      src/views/print/1000/print_list_zj.vue
  36. 489
      src/views/print/2000/print_list_zj.vue
  37. 339
      src/views/print/7000/print_list.vue
  38. 495
      src/views/print/print_list_bg.vue
  39. 354
      src/views/print/print_list_jl.vue
  40. 17
      src/views/task/list.vue
  41. 46
      src/views/user/department.vue
  42. 189
      src/views/user/role.vue
  43. 298
      src/views/user/user.vue

97
src/api/common.js

@ -33,3 +33,100 @@ export function backToLeaderFn(params) {
}
})
}
export function updateDepartmentFn(params) {
return api({
url: '/department',
method: 'put',
data: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function deleteDepartmentFn(params) {
return api({
url: '/department',
method: 'delete',
params: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function addDepartmentFn(data) {
return api({
url: '/department',
method: 'post',
data: data,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function updateTeamFn(params) {
return apibjd({
url: '/team',
method: 'put',
data: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function deleteTeamFn(params) {
return apibjd({
url: '/team',
method: 'delete',
params: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function addTeamFn(params) {
return apibjd({
url: '/team',
method: 'post',
data: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function deleteRenwuFn(params) {
return apibjd({
url: '/renwu',
method: 'delete',
params: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function cancelRenwuFn(params) {
return apibjd({
url: '/renwu/zfRenwu',
method: 'delete',
params: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function initData(params) {
return api({
url: '/role/listRole',
method: 'get',
params: params,
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
}
})
}
export function getDepartmentTreeList(params) {
return api({
url: '/department',
method: 'get',
params
})
}

9
src/api/data.js

@ -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'
})
}

40
src/api/dic_data.js

@ -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 }

46
src/api/instrument.js

@ -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 }

31
src/api/instrument_move.js

@ -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 }

52
src/api/role.js

@ -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 }

70
src/components/Crud/Delete/index.vue

@ -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>

21
src/components/Crud/Edit/index.vue

@ -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>

20
src/components/Crud/Pagination/index.vue

@ -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>

17
src/components/Crud/Query/index.vue

@ -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>

115
src/components/Crud/Table/index.vue

@ -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>

740
src/components/Crud/crud.js

@ -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
}

167
src/components/Crud/index.vue

@ -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>

169
src/components/TreeSelect/index.vue

@ -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>

111
src/components/drawerDialog/index.vue

@ -206,6 +206,17 @@
<el-tab-pane label="模板配置" name="1">
<div class="boxRoot">
<div class="left">
<div class="funbox">
<p>模板详情</p>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="addTemFn"
>
新增
</el-button>
</div>
<el-table
ref="settingList"
:data="list"
@ -269,6 +280,7 @@
<el-table-column
align="center"
label="表格模式"
width="150"
prop="tableMode"
>
<template slot-scope="scope">
@ -321,12 +333,12 @@
type="primary"
icon="el-icon-plus"
size="mini"
@click="addFn"
@click="addtemFn"
>
新增
</el-button>
</div>
<el-table :data="gridData" border>
<el-table :data="gridData" border fit>
<el-table-column align="center" label="序号" width="50">
<template slot-scope="scope">
<span v-text="getIndex(scope.$index)" />
@ -342,7 +354,7 @@
<el-table-column
property="indexFromRight"
label="排序"
width="150"
width="90"
align="center"
/>
<el-table-column
@ -351,7 +363,7 @@
width="150"
align="center"
/>
<el-table-column align="center" label="操作" width="190">
<el-table-column align="center" label="操作" width="190" fixed="right">
<template slot-scope="scope">
<el-button
type="primary"
@ -372,6 +384,15 @@
</template>
</el-table-column>
</el-table>
<div class="bottomPage">
<pagination
v-show="totalCount1 > 0"
:total="totalCount1"
:page-num.sync="jyxmParams.pageNum"
:page-row.sync="jyxmParams.pageSize"
@pagination="getDemoList"
/>
</div>
</div>
</div>
</el-tab-pane>
@ -387,20 +408,25 @@
<el-input v-model="formLabelAlign.field" />
</el-form-item>
<el-form-item
label="列数值"
label="排序"
:rules="[
{ required: true, message: '请输入列数值', trigger: 'blur' },
{ required: true, message: '请输入排序', trigger: 'blur' },
]"
>
<el-input v-model="formLabelAlign.fieldMode" />
<el-input-number v-model="formLabelAlign.indexFromRight" :min="1" :max="10" label="索引" />
</el-form-item>
<el-form-item label="排序">
<el-input-number
v-model="formLabelAlign.indexFromRight"
:min="1"
:max="10"
@change="handleChange"
/>
<el-form-item label="模式">
<el-radio-group v-model="formLabelAlign.fieldMode">
<el-radio :label="0">
普通模式
</el-radio>
<el-radio :label="1">
USI模式
</el-radio>
<el-radio :label="2">
UNN模式
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -536,6 +562,7 @@ export default {
activeName: 0,
settingList: [],
formTemplate: {},
templateSettingId: '',
dialogVisible1: false,
formLabelAlign: {
field: '',
@ -553,13 +580,25 @@ export default {
tableMode: '',
tableRowCount: '',
tableStartRow: '',
templateId: '',
tableType: '1',
writeMode: '1'
},
// formTemplate:{},
dialogVisible: false,
bglxList: [],
categoryList: [],
categoryList: [
{
value: 'YSJL',
label: '原始记录'
}, {
value: 'JYBG',
label: '检验报告'
}, {
value: 'OTHER',
label: '其他'
}
],
jylbList: [],
neibuleibie: [],
nblbList: [],
@ -582,12 +621,23 @@ export default {
gridData: [],
sbpzLevelStatus: false,
multipleSelection: [],
moduleArr: []
moduleArr: [],
jyxmParams: {
pageNum: 1,
pageSize: 20,
templateId: '',
templateSettingId: ''
},
totalCount1: 0
}
},
mounted() {},
methods: {
open() {
console.log(this.id, 'hahahh')
this.listQuery.templateId = this.id
this.form.templateId = this.id
this.formLabelAlign.templateId = this.id
this.getList()
this.loadFormData(this.index)
this.getSbList(undefined, undefined, 1)
@ -598,12 +648,18 @@ export default {
getJylbList() {
this.getCategoryList('jylb', null, null)
},
addTemFn() {
this.dialogVisible1 = true
},
editFnTem(row) {
this.dialogVisible1 = true
row.tableType = row.tableType + ''
row.tableMode = row.tableMode + ''
this.form = row
},
addtemFn() {
this.dialogVisible = true
},
changeState() {},
getList() {
//
@ -618,6 +674,7 @@ export default {
this.list = data.list
this.totalCount = data.total * 1
this.getDemoList(data.list[0].id)
this.templateSettingId = data.list[0].id
})
},
deleteModelFn(row) {
@ -653,12 +710,12 @@ export default {
},
getDemoList(id) {
//
this.jyxmParams.templateSettingId = id
this.jyxmParams.templateId = this.id
this.api({
url: '/templateJyxm/getList',
method: 'get',
params: {
id: id
}
params: this.jyxmParams
}).then((data) => {
data.list.map((item) => {
if (item.fieldMode === 0) {
@ -670,6 +727,7 @@ export default {
}
})
this.gridData = data.list
this.totalCount1 = data.total
})
},
toggleFn(val) {
@ -680,12 +738,15 @@ export default {
this.formLabelAlign.field = row.filed
this.formLabelAlign.fieldMode = row.fieldMode
this.formLabelAlign.indexFromRight = row.indexFromRight
this.formLabelAlign.id = row.id
this.formLabelAlign.templateSettingId = row.id
this.formLabelAlign.templateId = this.id
},
handleChange(value) {
this.formLabelAlign.indexFromRight = value
},
onsubmit() {
this.formLabelAlign.templateSettingId = this.templateSettingId
this.formLabelAlign.templateId = this.id
this.api({
url: '/templateJyxm',
method: 'post',
@ -697,7 +758,7 @@ export default {
},
onsubmit1() {
this.api({
url: '/templateJyxm',
url: '/templateSetting',
method: 'post',
data: this.form
}).then((res) => {
@ -883,11 +944,13 @@ export default {
})
},
rowClick(row) {
console.log(row, '选择')
this.templateSettingId = row.id
this.$refs.settingList.toggleRowSelection(row)
this.getDemoList(row.id)
},
addFn() {
this.dialogVisible = true
this.dialogVisible1 = true
}
}
}
@ -906,12 +969,12 @@ export default {
justify-content: space-between;
}
.boxRoot .left {
width: 50%;
width: 59%;
border: 1px solid #eeeeee;
padding: 20px;
}
.boxRoot .right {
width: 49%;
width: 40%;
border: 1px solid #eeeeee;
padding: 20px;
}

124
src/components/subTable/index.vue

@ -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>

306
src/views/allot/old_list.vue

@ -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>

29
src/views/allot/team_list.vue

@ -110,6 +110,8 @@
<script>
import Sticky from '@/components/Sticky'
import { updateTeamFn, deleteTeamFn, addTeamFn } from '@/api/common'
export default {
name: 'TeamList',
components: { Sticky },
@ -204,6 +206,7 @@ export default {
})
},
saveTeam() {
this.tempDepartment.teamPerson = this.tempDepartment.teamPerson.toString()
// a
this.$refs['tempDepartment'].validate(valid => {
if (valid) {
@ -219,26 +222,17 @@ export default {
}
}
if (this.dialogStatus === 'update') {
this.apibjd({
url: 'team/update',
method: 'post',
data: {
renwuTeam: this.tempDepartment,
renyuans: this.renyuans
}
}).then(data => {
const data = Object.assign({}, this.tempDepartment)
console.log(data)
updateTeamFn(data).then(data => {
this.getList()
this.$message({ type: 'success', message: '修改成功!' })
this.dialogFormVisible = false
})
} else {
this.apibjd({
url: 'team/save',
method: 'post',
data: {
addTeamFn({
renwuTeam: this.tempDepartment,
renyuans: this.renyuans
}
}).then(data => {
this.getList()
this.$message({ type: 'success', message: '添加成功!' })
@ -272,14 +266,10 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apibjd({
url: '/team/delete',
method: 'delete',
params: {
deleteTeamFn({
ids: this.$refs.list.selection.map(rw => {
return rw.id
}).join(',')
}
}).then(data => {
this.getList()
})
@ -301,7 +291,7 @@ export default {
},
getDepartment() { //
this.api({
url: '/department/getAllDepartment',
url: '/department/all',
method: 'get'
}).then(data => {
this.depts = data
@ -315,6 +305,7 @@ export default {
}
},
getUserList(val) {
console.log(val)
this.api({
url: '/user/getUserListByDepartmentId',
method: 'get',

150
src/views/allot/zuofei_list.vue

@ -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>

150
src/views/base/list.vue

@ -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>

13
src/views/bjd/department_list.vue

@ -117,6 +117,7 @@
<script>
import Pagination from '@/components/Pagination'
import { deleteDepartmentFn } from '@/api/common'
export default {
name: 'BjdDepartment',
components: { Pagination },
@ -245,20 +246,10 @@ export default {
type: 'warning'
}).then(() => {
const pks = []
const qs = require('qs')
this.multipleSelection.forEach(category => {
pks.push(category.id)
})
this.api({
url: '/aaaa/delCategory', //
method: 'delete',
params: {
pks: pks
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then(() => {
deleteDepartmentFn({ pks: pks }).then(() => {
this.$message({ message: '删除成功。', type: 'success' })
this.getList()
})

9
src/views/bjd/dj_input.vue

@ -1460,6 +1460,7 @@
import Sticky from '@/components/Sticky'
import Utils from '../../utils/contact.js'
import Pagination from '@/components/Pagination'
import { deleteRenwuFn } from '@/api/common'
// import XLSX from 'xlsx'
export default {
name: 'AddProjectDJ',
@ -1824,7 +1825,7 @@ export default {
this.bjdDepartment.jianyanleibie = this.bjd.jianyanleibie
this.bjdDepartment.quhumingcheng = this.bjd.quhuadaima
this.apibjd({
url: '/bjdDepartment/getObj',
url: '/bjdDepartment/getBjdDepartment',
method: 'get',
params: this.bjdDepartment
}).then((data) => {
@ -2159,11 +2160,7 @@ export default {
//
const delid = this.tableData[this.delRowIndex[i]].id
if (delid != null) {
this.apibjd({
url: '/renwu/delRenwu',
method: 'delete',
params: { id: delid }
}).then((data) => {
deleteRenwuFn({ id: delid }).then((data) => {
//
})
}

7
src/views/bjd/jj_input.vue

@ -743,6 +743,7 @@ import Sticky from '@/components/Sticky'
import Utils from '../../utils/contact.js'
import Pagination from '@/components/Pagination'
import axios from 'axios'
import { deleteRenwuFn } from '@/api/common'
export default {
name: 'AddProjectJJ',
@ -1305,11 +1306,7 @@ export default {
//
const delid = this.tableData[this.delRowIndex[i]].id
if (delid != null) {
this.apibjd({
url: '/renwu/delRenwu',
method: 'delete',
params: { id: delid }
}).then(data => {
deleteRenwuFn({ id: delid }).then((data) => {
//
})
}

525
src/views/bjd/wx_list.vue

@ -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>

7
src/views/bjd/zj_input.vue

@ -375,6 +375,7 @@ import Sticky from '@/components/Sticky'
import Enclosure from '@/views/common/Enclosure'
import Utils from '../../utils/contact.js'
import XLSX from 'xlsx'
import { deleteRenwuFn } from '@/api/common'
export default {
name: 'AddProjectZJ',
@ -835,11 +836,7 @@ export default {
//
const delid = this.tableData[this.delRowIndex[i]].id
if (delid != null) {
this.apibjd({
url: '/renwu/delRenwu',
method: 'delete',
params: { id: delid }
}).then(data => {
deleteRenwuFn({ id: delid }).then((data) => {
//
})
}

362
src/views/bjd/zj_list.vue

@ -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>

444
src/views/bjd/zlsc_list.vue

@ -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;">&emsp;</span><span>有新上传资料</span>
<span class="identification" style="background-color: #08bdff;">&emsp;</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>

509
src/views/bjd/zlsc_list_all.vue

@ -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;">&emsp;</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>

316
src/views/device_management/components/Move.vue

@ -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'
// crudpresenter
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>

557
src/views/device_management/index.vue

@ -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'
// crudpresenter
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>

53
src/views/dic/category.vue

@ -1,5 +1,8 @@
<template>
<div class="app-container">
<el-row>
<el-col :span="12">
<el-card class="box-card">
<div class="filter-container">
<el-form>
<el-form-item>
@ -17,6 +20,34 @@
</el-form-item>
</el-form>
</div>
<el-table
ref="list"
:data="parentList"
:row-class-name="tableRowClassName"
border
fit
highlight-current-row
@row-click="onRowClick"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" align="center" label="序号" width="50" />
<el-table-column align="center" label="检验类别名称" prop="name" width="100" />
<el-table-column align="center" label="检验类别代码" prop="code" width="80" />
<el-table-column :formatter="formatSpecies" align="center" label="设备种类" prop="species" />
<el-table-column align="center" label="操作" prop="" min-width="20">
<template slot-scope="scope">
<el-button type="primary" size="medium" title="修改" @click="showUpdate(scope.$index)">
修改
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="totalCount>0" :total="totalCount" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" @pagination="getList" />
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<el-table
ref="list"
:data="list"
@ -40,7 +71,10 @@
</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" />
</el-card>
</el-col>
</el-row>
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" @close="closeDialog">
<el-form ref="tempCategory" :model="tempCategory" class="small-space" label-position="left" label-width="120px" style="width: 300px; margin-left:50px;">
<el-form-item label="检验类别名称" prop="name" required>
@ -96,6 +130,7 @@ export default {
data() {
return {
totalCount: 0, // --
subList: [],
list: [], //
listQuery: {
pageNum: 1, //
@ -112,13 +147,15 @@ export default {
multipleSelection: [],
sbzlList: [],
species: [],
parentList: []
parentList: [],
leftList:[]
}
},
created() {
this.getList()
this.getSbzlList()
this.getParentList()
this.getLeftList()
},
methods: {
getList() {
@ -247,6 +284,18 @@ export default {
this.parentList = data
})
},
getLeftList(){
this.api({
url: '/getTopLevel',
method: 'get',
params: {
pageNum:10,
pageSize:10
}
}).then(data => {
this.leftList = data
})
},
closeDialog() {
this.species = []
},

415
src/views/dic/dic_type.vue

@ -1,40 +1,210 @@
<template>
<div class="app-container">
<el-row>
<el-col :span="12">
<el-card class="box-card">
<div class="filter-container">
<el-form>
<el-form-item>
<el-input v-model="listQuery.typeCode" placeholder="请输入类型代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.typeName" placeholder="请输入类型名称" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
<el-button type="primary" icon="el-icon-search" @click="handleFilter">
<el-input
v-model="listQuery.typeCode"
placeholder="请输入类型代码"
clearable
style="width: 200px"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.typeName"
placeholder="请输入类型名称"
clearable
style="width: 200px"
@keyup.enter.native="handleFilter"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleFilter"
>
查询
</el-button>
<el-button type="primary" icon="el-icon-edit" @click="showCreate">
<el-button
type="primary"
icon="el-icon-edit"
@click="showCreate"
>
添加
</el-button>
<el-button type="danger" icon="el-icon-delete" @click="deleteDicType">
<el-button
type="danger"
icon="el-icon-delete"
@click="deleteDicType"
>
删除
</el-button>
</el-form-item>
</el-form>
</div>
<el-table ref="list" :data="list" border fit highlight-current-row stripe @row-click="onRowClick" @selection-change="handleSelectionChange">
<el-table
ref="list"
:data="list"
border
height="700"
fit
highlight-current-row
stripe
@row-click="onRowClick"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column align="center" type="index" label="序号" width="80" />
<el-table-column align="center" label="字典类型代码" prop="typeCode" min-width="40" />
<el-table-column align="center" label="字典类型名称" prop="typeName" min-width="40" />
<el-table-column align="center" label="字典类型释义" prop="typeNotes" />
<el-table-column align="center" label="排序序号" prop="sort" min-width="10" />
<el-table-column align="center" label="操作" prop="" min-width="20">
<el-table-column
align="center"
type="index"
label="序号"
width="50"
/>
<el-table-column
align="center"
label="字典类型代码"
prop="typeCode"
width="160"
/>
<el-table-column
align="center"
label="字典类型名称"
prop="typeName"
width="100"
/>
<el-table-column
align="center"
label="字典类型释义"
prop="typeNotes"
width="160"
/>
<el-table-column
align="center"
label="排序序号"
prop="sort"
min-width="10"
/>
<el-table-column
align="center"
label="操作"
prop=""
min-width="20"
fixed="right"
>
<template slot-scope="scope">
<el-button type="primary" size="medium" title="修改" @click="showUpdate(scope.$index)">
<el-button
type="primary"
size="medium"
title="修改"
@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.pageSize" @pagination="getList" />
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page-num.sync="listQuery.pageNum"
:page-row.sync="listQuery.pageSize"
@pagination="getList"
/>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>字典详情</span>
<el-button type="primary" icon="el-icon-edit" style="float: right;margin-right:10px" @click="subshowCreate">
添加
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
style="float: right;"
@click="subdeleteDicType"
>
删除
</el-button>
</div>
<el-table
ref="list"
:data="sublist"
border
fit
height="700"
highlight-current-row
stripe
@row-click="onRowClick"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column
align="center"
type="index"
label="序号"
width="50"
/>
<el-table-column
align="center"
label="字典代码"
prop="code"
min-width="20"
/>
<el-table-column
align="center"
label="字典名称"
prop="name"
min-width="40"
/>
<el-table-column
align="center"
label="字典值"
prop="value"
min-width="20"
/>
<el-table-column align="center" label="字典说明" prop="notes" width="150" />
<el-table-column
align="center"
label="排序序号"
prop="sort"
min-width="15"
/>
<el-table-column
align="center"
label="操作"
prop=""
min-width="20"
fixed="right"
>
<template slot-scope="scope">
<el-button
type="primary"
size="medium"
title="修改"
@click="subshowUpdate(scope.$index)"
>
修改
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="subtotalCount>0" :total="subtotalCount" :page-num.sync="sublistQuery.pageNum" :page-row.sync="sublistQuery.pageSize" @pagination="getsubList" />
</el-card>
</el-col>
</el-row>
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
<el-form ref="tempDicType" :model="tempDicType" class="small-space" label-position="left" label-width="120px" style="width: 300px; margin-left:50px;">
<el-form
ref="tempDicType"
:model="tempDicType"
class="small-space"
label-position="left"
label-width="120px"
style="width: 300px; margin-left: 50px"
>
<el-form-item label="字典类型代码" prop="typeCode" required>
<el-input v-model="tempDicType.typeCode" type="text" />
</el-form-item>
@ -52,7 +222,11 @@
<el-button @click="dialogFormVisible = false">
</el-button>
<el-button v-if="dialogStatus==='create'" type="success" @click="createDicType">
<el-button
v-if="dialogStatus === 'create'"
type="success"
@click="createDicType"
>
</el-button>
<el-button v-else type="primary" @click="updateDicType">
@ -60,6 +234,46 @@
</el-button>
</div>
</el-dialog>
<el-dialog :title="textMap[dialogStatus]" :visible.sync="secondDialogFormVisible">
<el-form ref="tempDicData" :model="tempDicData" class="small-space" label-position="left" label-width="120px" style="width: 300px; margin-left:50px;">
<el-form-item label="字典类型" prop="typeId" required>
<el-select v-model="tempDicData.typeId" filterable placeholder="请选择字典类型" clearable>
<el-option v-for="item in dicTypeList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="字典代码" prop="code" required>
<el-input v-model="tempDicData.code" type="text" />
</el-form-item>
<el-form-item label="字典名称" prop="name" required>
<el-input v-model="tempDicData.name" type="text" />
</el-form-item>
<el-form-item label="字典值" prop="value" required>
<el-input v-model="tempDicData.value" type="text" />
</el-form-item>
<el-form-item label="字典说明" prop="notes">
<el-input v-model="tempDicData.notes" :rows="3" type="textarea" />
</el-form-item>
<el-form-item label="所属父类" prop="parentId">
<el-select v-model="tempDicData.parentId" filterable placeholder="请选择所属父类" clearable>
<el-option v-for="item in dicDataList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="排序序号" prop="sort" required>
<el-input-number v-model="tempDicData.sort" :min="1" :max="100" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
</el-button>
<el-button v-if="dialogStatus==='create'" type="success" @click="subcreateDicData">
</el-button>
<el-button v-else type="primary" @click="subupdateDicData">
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
@ -72,22 +286,37 @@ export default {
return {
totalCount: 0, // --
list: [], //
sublist: [],
listQuery: {
pageNum: 1, //
pageSize: 20
pageSize: 10
},
sublistQuery: {
pageNum: 1, //
pageSize: 10,
typeId: ''
},
dialogStatus: 'create',
dialogFormVisible: false,
secondDialogFormVisible: false,
textMap: {
update: '编辑',
create: '新建字典类型'
},
tempDicType: {},
multipleSelection: []
multipleSelection: [],
dicTypeList: [],
dicDataList: [],
subtotalCount: 0,
tempDicData: {
}
}
},
created() {
this.getList()
this.getDicType()
this.getAllDicData()
},
methods: {
getList() {
@ -95,11 +324,31 @@ export default {
url: '/dicType/list',
method: 'get',
params: this.listQuery
}).then(data => {
}).then((data) => {
this.list = data.list
this.totalCount = data.total
})
},
getAllDicData() {
this.api({
url: '/dicData/getAllDicData',
method: 'get'
}).then(data => {
this.dicDataList = data
})
},
getsubList() {
this.api({
url: '/dicData/list',
method: 'get',
params: this.sublistQuery
}).then((data) => {
this.sublist = data.list
this.subtotalCount = data.total
this.spanArr = []
this.getSpanArr(this.list)
})
},
handleFilter() {
//
this.listQuery.pageNum = 1
@ -107,6 +356,8 @@ export default {
},
onRowClick(row) {
this.$refs.list.toggleRowSelection(row)
this.sublistQuery.typeId = row.id
this.getsubList()
},
handleSelectionChange: function(val) {
this.multipleSelection = val
@ -122,7 +373,7 @@ export default {
this.dialogFormVisible = true
},
createDicType() {
this.$refs['tempDicType'].validate(valid => {
this.$refs['tempDicType'].validate((valid) => {
if (valid) {
this.api({
url: '/dicType/addDicType',
@ -138,8 +389,9 @@ export default {
}
})
},
updateDicType() {
this.$refs['tempDicType'].validate(valid => {
this.$refs['tempDicType'].validate((valid) => {
if (valid) {
this.api({
url: '/dicType/updateDicType',
@ -155,6 +407,21 @@ export default {
}
})
},
getDicType() {
this.api({
url: '/dicType/getAllDicType',
method: 'get'
}).then(data => {
this.dicTypeList = data
})
},
getDicTypeName(row, column, cellValue) {
for (let i = 0; i < this.dicTypeList.length; i++) {
if (this.dicTypeList[i].value === cellValue.toString()) {
return this.dicTypeList[i].label
}
}
},
deleteDicType() {
if (this.multipleSelection.length === 0) {
this.$message({
@ -170,7 +437,7 @@ export default {
}).then(() => {
const pks = []
const qs = require('qs')
this.multipleSelection.forEach(dicType => {
this.multipleSelection.forEach((dicType) => {
pks.push(dicType.id)
})
this.api({
@ -189,7 +456,111 @@ export default {
})
})
}
},
subshowCreate() {
this.tempDicData = {}
this.getAllDicData()
this.dialogStatus = 'create'
this.secondDialogFormVisible = true
},
subshowUpdate($index) {
this.tempDicData = this.sublist[$index]
this.getAllDicData()
this.tempDicData.parentId = this.sublist[$index].typeId
this.dialogStatus = 'update'
this.secondDialogFormVisible = true
},
subcreateDicData() {
this.$refs['tempDicData'].validate(valid => {
if (valid) {
this.api({
url: '/dicData/addDicData',
method: 'post',
data: this.tempDicData
}).then(() => {
this.$message({ message: '添加成功。', type: 'success' })
this.getList()
this.secondDialogFormVisible = false
})
} else {
return false
}
})
},
subupdateDicData() {
this.$refs['tempDicData'].validate(valid => {
if (valid) {
this.api({
url: '/dicData/updateDicData',
method: 'post',
data: this.tempDicData
}).then(() => {
this.$message({ message: '更新成功。', type: 'success' })
this.getList()
this.secondDialogFormVisible = false
})
} else {
return false
}
})
},
subdeleteDicType() {
if (this.multipleSelection.length === 0) {
this.$message({
type: 'error',
message: '请选中需要删除的数据!'
})
return false
} else {
this.$confirm('确定删除当前选中记录?', '提示', {
confirmButtonText: '确定',
showCancelButton: true,
type: 'warning'
}).then(() => {
const pks = []
const qs = require('qs')
this.multipleSelection.forEach(dicData => {
pks.push(dicData.id)
})
this.api({
url: '/dicData',
method: 'delete',
params: {
ids: pks
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then(() => {
this.$message({ message: '删除成功。', type: 'success' })
this.getList()
})
})
}
}
}
}
</script>
<style scoped>
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.box-card {
width: 98%;
overflow-y: scroll;
}
</style>

16
src/views/preview/old_project.vue

@ -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>

427
src/views/print/1000/print_list_depar.vue

@ -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>

476
src/views/print/1000/print_list_zj.vue

@ -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>

489
src/views/print/2000/print_list_zj.vue

@ -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>
&nbsp;
<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>

339
src/views/print/7000/print_list.vue

@ -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>

495
src/views/print/print_list_bg.vue

@ -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>

354
src/views/print/print_list_jl.vue

@ -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>

17
src/views/task/list.vue

@ -228,6 +228,8 @@ import SliceUpload from '@/components/SliceUpload'
import Pagination from '@/components/Pagination'
import Utils from '../../utils/contact.js'
import { getOwnList, terminateRenwu, completeRenwuFn } from '@/api/renwu'
import { cancelRenwuFn } from '@/api/common'
import Enclosure from '@/views/common/Enclosure'
export default {
name: 'MyTask',
@ -641,21 +643,14 @@ export default {
this.$message({ message: '请填写作废原因!', type: 'warning' })
return false
}
this.apibjd({
url: 'renwu/deleteRenwu',
method: 'delete',
params: {
renwuIds: this.$refs.list.selection.map(rw => {
const arr = this.$refs.list.selection.map(rw => {
return rw.id
}).join(','),
})
cancelRenwuFn({
renwuIds: arr,
reason: value
}
}).then(data => {
if (data) {
this.$message.success('作废成功!')
} else {
this.$message.error('作废失败!')
}
this.getList()
})
}).catch(() => {

46
src/views/user/department.vue

@ -16,10 +16,20 @@
</el-form-item>
</el-form>
</div>
<el-table ref="list" :data="list" border fit highlight-current-row @row-click="onRowClick" @selection-change="handleSelectionChange">
<el-table
ref="list"
:data="list"
border
row-key="id"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
highlight-current-row
@row-click="onRowClick"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" align="center" label="序号" width="80" />
<el-table-column align="center" label="部门名称" prop="name" style="width: 60px;" />
<el-table-column label="部门名称" prop="name" style="width: 60px;" />
<el-table-column :formatter="formatter.getChineseName" align="center" label="负责人" prop="leader" style="width: 60px;" />
<el-table-column align="center" label="创建时间" prop="createTime" style="width: 60px;" />
<el-table-column align="center" label="最近修改时间" prop="updateTime" style="width: 60px;" />
@ -67,6 +77,8 @@
</template>
<script>
import Pagination from '@/components/Pagination'
import { updateDepartmentFn, deleteDepartmentFn, addDepartmentFn } from '@/api/common'
export default {
name: 'DepartmentList',
components: { Pagination },
@ -101,11 +113,11 @@ export default {
getList() {
//
this.api({
url: '/department/listDepartment',
url: '/department/tree',
method: 'get',
params: this.listQuery
}).then(data => {
this.list = data.list
this.list = data
this.totalCount = data.total
})
},
@ -156,11 +168,7 @@ export default {
this.$refs['tempDepartment'].validate(valid => {
if (valid) {
this.tempDepartment.userList = this.departmentUserList
this.api({
url: '/department/addDepartment',
method: 'post',
data: this.tempDepartment
}).then(() => {
addDepartmentFn(this.tempDepartment).then(() => {
this.$message.success('添加成功。')
this.getList()
this.dialogFormVisible = false
@ -175,11 +183,7 @@ export default {
this.$refs['tempDepartment'].validate(valid => {
if (valid) {
this.tempDepartment.userList = this.departmentUserList
this.api({
url: '/department/updateDepartment',
method: 'post',
data: this.tempDepartment
}).then(() => {
updateDepartmentFn(this.tempDepartment).then(() => {
this.$message.success('修改成功。')
this.getList()
this.dialogFormVisible = false
@ -195,7 +199,6 @@ export default {
return
}
const pks = []
const qs = require('qs')
this.multipleSelection.forEach(department => {
pks.push(department.id)
})
@ -204,17 +207,8 @@ export default {
showCancelButton: '取消',
type: 'warning'
}).then(() => {
this.api({
url: '/department/deleteDepartment',
method: 'delete',
params: {
pks: pks
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then(() => {
this.$message.success('删除成功。')
deleteDepartmentFn({ pks: pks }).then(() => {
this.$message({ message: '删除成功。', type: 'success' })
this.getList()
})
})

189
src/views/user/role.vue

@ -92,6 +92,59 @@
</el-button>
</div>
</el-dialog>
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="1100px">
<el-form ref="tempRole" :model="tempRole" class="small-space" label-position="left" label-width="100px" style="margin-left:50px;height: 600px;overflow: auto;">
<el-form-item label="角色名称" required>
<el-input v-model="tempRole.roleName" type="text" style="width: 200px;" />
</el-form-item>
<el-form-item label="角色代码" required>
<el-input v-model="tempRole.roleCode" type="text" style="width: 200px;" />
</el-form-item>
<el-form-item label="功能权限:">
<el-table
ref="menuList"
:data="allPermission"
border
fit
highlight-current-row
row-key="permission.id"
:default-expand-all="true"
:tree-props="{children: 'allPermissionVOList', hasChildren: 'hasChildren'}"
>
<el-table-column label="菜单名称" width="180">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.checked" @change="handleCheckAllChange(scope.row, $event)">
{{ scope.row.permission.title }}
</el-checkbox>
</template>
</el-table-column>
<el-table-column label="功能选项">
<template slot-scope="scope">
<el-checkbox
v-for="options in scope.row.resourcePermissionList"
:key="options.id"
v-model="options.permissionId"
:label="options.permissionType"
@change="handleCheckChange(scope.row)"
/>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
</el-button>
<el-button v-if="dialogStatus==='create'" type="success" @click="createRole">
</el-button>
<el-button v-else type="primary" @click="updateRole">
</el-button>
</div>
</el-dialog>
<!-- 用户授权窗口 -->
<el-dialog :title="'角色授权'" :visible.sync="authDialogFormVisible">
<el-container>
@ -166,7 +219,8 @@ export default {
menuNameList: [],
permissionList: [],
depts: [],
allPermissionVOList: []
allPermissionVOList: [],
checkedIds: new Set()
}
},
created() {
@ -203,7 +257,7 @@ export default {
//
getDepartment() {
this.api({
url: '/department/getAllDepartment',
url: '/department/all',
method: 'get'
}).then(data => {
this.depts = data
@ -216,7 +270,7 @@ export default {
}).then(data => {
this.allPermission = data
if (this.allPermission.length > 0) {
this.allPermissionVOList = this.allPermission[0].allPermissionVOList
this.allPermissionVOList = this.allPermission[0].resourcePermissionList
}
})
},
@ -518,6 +572,135 @@ export default {
}
}
return result
},
handleCheckAllChange(val, checked) {
console.log(val, '是啥')
//
if (val.allPermissionVOList.length > 0) {
if (checked) {
this.checkedIds.add(val.resourcePermissionList[0].id)
} else {
this.checkedIds.delete(val.resourcePermissionList[0].id)
}
this.findChildren(val.allPermissionVOList, checked)
} else {
//
val.resourcePermissionList.forEach(options => {
options.checked = checked
if (checked) {
this.checkedIds.add(options.id)
} else {
this.checkedIds.delete(options.id)
}
})
}
// //
// if (val.permission.id !== 0) {
// this.findParent(this.allPermission, val.permission.parentId)
// }
val.indeterminate = false
},
handleCheckChange(val) {
console.log(val, '子功能')
const length = val.resourcePermissionList.length
let checkedLength = 0
val.resourcePermissionList.forEach(options => {
if (options.checked) {
this.checkedIds.add(options.id)
checkedLength++
} else {
this.checkedIds.delete(options.id)
}
})
val.checked = checkedLength === length
val.indeterminate = checkedLength > 0 && checkedLength < length
//
if (val.menu.parentId !== 0) {
this.findParent(this.menuList, val.menu.parentId)
}
},
findChildren(list, checked) {
list.forEach(children => {
children.checked = checked
children.indeterminate = false
children.resourcePermissionList.forEach(options => {
options.checked = checked
if (checked) {
this.checkedIds.add(options.id)
} else {
this.checkedIds.delete(options.id)
}
if (children.children.length > 0) {
this.findChildren(children.children, checked)
}
})
})
},
findParent(list, parentId) {
list.forEach(result => {
let parentCheckedLength = 0
let parentIndeterminateLength = 0
//
if (result.menu.id === parentId) {
//
result.children.forEach(children => {
if (children.indeterminate) {
parentIndeterminateLength++
} else if (children.checked) {
parentCheckedLength++
}
})
result.checked = parentCheckedLength === result.children.length
result.indeterminate = (parentIndeterminateLength > 0 || parentCheckedLength > 0) && parentCheckedLength < result.children.length
if (result.checked || result.indeterminate) {
this.checkedIds.add(result.resourcePermissionList[0].id)
} else {
this.checkedIds.delete(result.resourcePermissionList[0].id)
}
//
if (result.menu.parentId !== 0) {
this.findParent(this.menuList, result.menu.parentId)
}
} else if (result.children.length > 0) {
this.findParent(result.children, parentId)
}
})
},
echoChildren(list, optionsIds) {
list.forEach(result => {
if (result.children.length === 0) {
this.settingChecked(result, optionsIds)
} else {
this.echoChildren(result.children, optionsIds)
}
})
},
settingChecked(result, optionsIds) {
let matching = false
result.resourcePermissionList.forEach(options => {
optionsIds.forEach(optionsId => {
if (options.id === optionsId) {
options.checked = true
matching = true
}
})
})
if (matching) {
this.handleCheckChange(result)
}
},
//
clearChecked(menuList) {
menuList.forEach(menu => {
menu.checked = false
menu.indeterminate = false
menu.resourcePermissionList.forEach(options => {
options.checked = false
})
if (menu.children.length > 0) {
this.clearChecked(menu.children)
}
})
}
}
}

298
src/views/user/user.vue

@ -3,66 +3,149 @@
<div class="filter-container">
<el-form>
<el-form-item>
<el-input v-model="listQuery.nickname" placeholder="昵称" style="width: 200px" clearable @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.username" placeholder="用户名" style="width: 100px" clearable @keyup.enter.native="handleFilter" />
<el-select v-model="listQuery.departmentId" placeholder="请选择科室" clearable>
<el-option v-for="dept in depts" :key="dept.id" :label="dept.name" :value="dept.id" />
</el-select>
<el-button type="primary" icon="el-icon-search" @click="handleFilter">
<el-input
v-model="filterText"
placeholder="输入部门关键字进行过滤"
style="width: 200px"
/>
<el-input
v-model="query.nickname"
placeholder="昵称"
style="width: 200px"
clearable
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.username"
placeholder="用户名"
style="width: 100px"
clearable
@keyup.enter.native="crud.toQuery"
/>
<el-button type="primary" icon="el-icon-search" @click="crud.toQuery">
查询
</el-button>
<el-button v-if="hasPerm('user:add')" type="primary" icon="el-icon-edit" @click="showCreate">
<el-button
v-if="hasPerm('user:add')"
type="primary"
icon="el-icon-edit"
@click="showCreate"
>
添加
</el-button>
<el-button icon="el-icon-document" type="primary" @click="handleDownload">
<el-button
icon="el-icon-document"
type="primary"
@click="handleDownload"
>
导出Excel
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="list" border fit highlight-current-row>
<el-table-column type="index" align="center" label="序号" width="80" />
<el-table-column align="center" label="昵称" prop="nickname" />
<el-table-column align="center" label="用户名" prop="username" />
<el-table-column :formatter="formatterRoleId" align="center" label="角色" prop="roleIds" width="120px" />
<el-table-column :formatter="formatterDepartmentName" align="center" label="所属部门" prop="departmentId" width="140px" />
<el-table-column align="center" label="创建时间" prop="createTime" width="170" />
<el-table-column align="center" label="最近修改时间" prop="updateTime" width="170" />
<el-table-column v-if="hasPerm('user:update')" align="center" label="管理" width="220">
<el-row>
<el-col :span="4">
<el-tree
ref="tree"
:data="treeData"
:filter-node-method="filterNode"
:props="defaultProps"
node-key="id"
:default-expanded-keys="[1]"
@node-click="handleNodeClick"
/>
</el-col>
<el-col :span="20">
<!--表格内容-->
<CustomTable ref="customTable" :col-configs="colConfigs" :columns="columns" :crud="crud">
<el-table-column slot="operation" align="center" width="100" label="操作">
<template slot-scope="scope">
<el-button :disabled="scope.row.username === 'admin'" type="primary" icon="edit" @click="showUpdate(scope.$index)">
修改
</el-button>
<el-button :disabled="scope.row.username === 'admin'" type="danger" icon="delete" @click="removeUser(scope.$index)">
删除
</el-button>
<Edit :data="scope.row" :disabled-edit="false" />
<Delete :data="scope.row" style="margin-left: 5px" />
</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" />
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
<el-form ref="tempUser" :model="tempUser" :rules="rules" class="small-space" label-position="left" label-width="120px" style="width: 300px; margin-left:50px;">
<el-form-item v-if="dialogStatus==='create'" label="用户名" prop="username" required>
</CustomTable>
<pagination />
</el-col>
</el-row>
<el-dialog :title="textMap[dialogStatus]" :visible="crud.status.editor > 0">
<el-form
ref="tempUser"
:model="tempUser"
:rules="rules"
class="small-space"
label-position="left"
label-width="120px"
style="width: 300px; margin-left: 50px"
>
<el-form-item
v-if="dialogStatus === 'create'"
label="用户名"
prop="username"
required
>
<el-input v-model="tempUser.username" type="text" />
</el-form-item>
<el-form-item v-if="dialogStatus==='create'" label="昵称" prop="nickname" required>
<el-form-item
v-if="dialogStatus === 'create'"
label="昵称"
prop="nickname"
required
>
<el-input v-model="tempUser.nickname" type="text" />
</el-form-item>
<el-form-item v-if="dialogStatus==='create'" label="密码" prop="password" required>
<el-form-item
v-if="dialogStatus === 'create'"
label="密码"
prop="password"
required
>
<el-input v-model="tempUser.password" type="password" />
</el-form-item>
<el-form-item v-else label="新密码">
<el-input v-model="tempUser.password" type="password" placeholder="不填则表示不修改" />
<el-input
v-model="tempUser.password"
type="password"
placeholder="不填则表示不修改"
/>
</el-form-item>
<el-form-item v-if="dialogStatus==='update'" label="新签名密码" prop="signPassword">
<el-input v-model="tempUser.signPassword" type="password" placeholder="不填则表示不修改" />
<el-form-item
v-if="dialogStatus === 'update'"
label="新签名密码"
prop="signPassword"
>
<el-input
v-model="tempUser.signPassword"
type="password"
placeholder="不填则表示不修改"
/>
</el-form-item>
<el-form-item label="角色" prop="roleIds">
<el-select v-model="roleIds" multiple placeholder="请选择" style="width: 180px">
<el-option v-for="item in roles" :key="item.id" :label="item.roleName" :value="item.id" />
<el-select
v-model="roleIds"
multiple
placeholder="请选择"
style="width: 180px"
>
<el-option
v-for="item in roles"
:key="item.id"
:label="item.roleName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-upload v-if="dialogStatus==='update'" :before-upload="beforeUpload" :on-remove="handleRemove" :file-list="fileList" :limit="1" action="123" list-type="picture">
<el-upload
v-if="dialogStatus === 'update'"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:file-list="fileList"
:limit="1"
action="123"
list-type="picture"
>
<el-button size="small" type="primary">
点击上传签名图片
</el-button>
@ -72,10 +155,14 @@
</el-upload>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
<el-button @click="crud.cancelCU">
</el-button>
<el-button v-if="dialogStatus==='create'" type="success" @click="createUser">
<el-button
v-if="dialogStatus === 'create'"
type="success"
@click="createUser"
>
</el-button>
<el-button v-else type="primary" @click="updateUser">
@ -86,14 +173,53 @@
</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 Delete from '@/components/Crud/Delete'
import CustomTable from '@/components/Crud/Table'
import Pagination from '@/components/Crud/Pagination'
import CrudRole from '@/api/role'
import { mapGetters } from 'vuex'
import { parseTime } from '../../utils'
import Pagination from '@/components/Pagination'
// import Pagination from '@/components/Pagination'
// crudpresenter
const defaultCrud = presenter(CRUD({
title: '用户',
url: '/user/list',
orderBy: ['id asc'],
param: {},
crudMethod: { ...CrudRole }
}))
// form
const defaultForm = form({
id: null,
roleName: '',
roleCode: '',
menuOptionIds: {}
})
export default {
name: 'UserList',
components: { Pagination },
components: { Pagination, CustomTable, Edit, Delete },
mixins: [defaultCrud, defaultForm, header()],
data() {
return {
defaultProps: {
children: 'children',
label: 'name'
},
colConfigs: [
{ prop: 'nickname', label: '昵称', align: 'center' },
{ prop: 'username', label: '用户名', align: 'center' },
{ prop: 'departmentId', label: '所属部门', align: 'center' },
{ prop: 'createTime', label: '创建时间', align: 'center' },
{ prop: 'updateTime', label: '最近修改时间', align: 'center' },
{ slot: 'operation' }
],
treeData: [],
filterText: '',
totalCount: 0, // --
list: [], //
listQuery: {
@ -114,12 +240,8 @@ export default {
username: [
{ required: true, message: '请填写用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请填写密码', trigger: 'blur' }
],
nickname: [
{ required: true, message: '请填写昵称', trigger: 'blur' }
]
password: [{ required: true, message: '请填写密码', trigger: 'blur' }],
nickname: [{ required: true, message: '请填写昵称', trigger: 'blur' }]
},
fileList: [],
depts: [],
@ -129,45 +251,75 @@ export default {
computed: {
...mapGetters(['userId'])
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList()
// this.getList()
this.getDepartment()
this.getAllDepartment()
if (this.hasPerm('user:add') || this.hasPerm('user:update')) {
this.getAllRoles()
}
console.log(this.crud, this.query, '啊哈哈哈')
},
methods: {
getAllRoles() {
this.api({
url: '/role/getAllRoles',
method: 'get'
}).then(data => {
}).then((data) => {
this.roles = data
})
},
//
getDepartment() {
this.api({
url: '/department/getAllDepartment',
url: '/department/all',
method: 'get'
}).then(data => {
}).then((data) => {
this.depts = data
})
},
getAllDepartment() {
this.api({
url: '/department/tree',
method: 'get'
}).then((data) => {
this.treeData = data
})
},
getList() {
//
this.api({
url: '/user/list',
method: 'get',
params: this.listQuery
}).then(data => {
}).then((data) => {
this.list = data.list
this.totalCount = data.total
})
},
handleNodeClick(data) {
if (data.id === 1) {
this.departmentId = 0
this.query.departmentId = null
} else {
this.departmentId = data.id
this.query.departmentId = data.id
}
this.crud.toQuery()
},
filterNode(value, data) {
console.log(value, data)
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleFilter() {
//
this.listQuery.pageNum = 1
this.query.pageNum = 1
this.getList()
},
handleRemove(file, fileList) {
@ -187,10 +339,11 @@ export default {
url: '/upload/uploadSignImg',
method: 'post',
data: fd
}).then(data => {
}).then((data) => {
this.tempUser.signImg = data
this.fileList = JSON.parse(data)
this.fileList[0].url = process.env.VUE_APP_IMG_URL + 'signImage/' + this.fileList[0].name
this.fileList[0].url =
process.env.VUE_APP_IMG_URL + 'signImage/' + this.fileList[0].name
})
return true
},
@ -198,6 +351,7 @@ export default {
//
this.tempUser = {}
this.dialogStatus = 'create'
console.log(this.crud.status.editor, '哈哈哈')
this.dialogFormVisible = true
this.roleIds.length = 0
},
@ -207,14 +361,17 @@ export default {
this.roleIds.length = 0
if (user.roleIds !== null && user.roleIds !== undefined) {
if (user.roleIds.indexOf(',') !== -1) {
user.roleIds.split(',').forEach(roleId => this.roleIds.push(Number(roleId)))
user.roleIds
.split(',')
.forEach((roleId) => this.roleIds.push(Number(roleId)))
}
}
if (user.signImg !== null && user.signImg !== '') {
this.tempUser.signImg = user.signImg
this.fileList = JSON.parse(user.signImg)
if (this.fileList.length > 0) {
this.fileList[0].url = process.env.VUE_APP_IMG_URL + 'signImage/' + this.fileList[0].name
this.fileList[0].url =
process.env.VUE_APP_IMG_URL + 'signImage/' + this.fileList[0].name
}
} else {
this.fileList = []
@ -224,7 +381,7 @@ export default {
},
createUser() {
//
this.$refs['tempUser'].validate(valid => {
this.$refs['tempUser'].validate((valid) => {
if (valid) {
if (this.tempUser.password.length < 8) {
this.$message.warning('密码长度不能低于8位')
@ -241,7 +398,7 @@ export default {
}).then(() => {
this.$message.success('添加成功。')
this.getList()
this.dialogFormVisible = false
this.crud.cancelCU()
})
} else {
return false
@ -250,7 +407,7 @@ export default {
},
updateUser() {
//
this.$refs['tempUser'].validate(valid => {
this.$refs['tempUser'].validate((valid) => {
if (valid) {
if (this.tempUser.password && this.tempUser.password.length < 8) {
this.$message.warning('密码长度不能低于8位')
@ -309,8 +466,15 @@ export default {
})
},
handleDownload() {
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['Id', '昵称', '用户名', '角色', '创建时间', '最近修改时间']
import('@/vendor/Export2Excel').then((excel) => {
const tHeader = [
'Id',
'昵称',
'用户名',
'角色',
'创建时间',
'最近修改时间'
]
const filterVal = [
'id',
'nickname',
@ -330,8 +494,8 @@ export default {
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v =>
filterVal.map(j => {
return jsonData.map((v) =>
filterVal.map((j) => {
if (j === 'timestamp') {
return parseTime(v[j])
} else {
@ -343,8 +507,10 @@ export default {
formatterRoleId(row, column, cellValue) {
if (cellValue) {
const roleName = []
cellValue.split(',').forEach(roleId => {
const role = this.roles.filter(role => role.id === Number(roleId))[0]
cellValue.split(',').forEach((roleId) => {
const role = this.roles.filter(
(role) => role.id === Number(roleId)
)[0]
if (role) {
roleName.push(role.roleName)
}
@ -357,7 +523,7 @@ export default {
formatterDepartmentName(row, column, cellValue) {
if (cellValue !== null) {
let departmentName
this.depts.forEach(dep => {
this.depts.forEach((dep) => {
if (dep.id === cellValue) {
departmentName = dep.name
return false

Loading…
Cancel
Save