Browse Source

打印记录

test
wangxy 3 years ago
parent
commit
a370e2f67c
2 changed files with 187 additions and 0 deletions
  1. +60
    -0
      src/views/system/printer/printheadtab/addOrEdit.vue
  2. +127
    -0
      src/views/system/printer/printheadtab/index.vue

+ 60
- 0
src/views/system/printer/printheadtab/addOrEdit.vue View File

@ -0,0 +1,60 @@
<template>
<el-dialog :title="title" model-value width="90%" :close-on-click-modal="false" :before-close="cancel">
<el-table :data="dataDetails" border>
<el-table-column v-for="(item, index) in formHeader" :key="index" align="center" :label="getColumnName(item)" :show-overflow-tooltip="true">
<template #default="scope">
<span v-if="item === 'PrintDetail-PlantNr'">{{ getValue(scope.row['PrintDetail-PlantNr']) }}</span>
<span v-else-if="item === 'PrintDetail-LastModify'"> {{ parseTime(scope.row[item]) }} </span>
<span v-else-if="item === 'PrintDetail-CreateTime'"> {{ parseTime(scope.row[item]) }} </span>
<span v-else>{{ scope.row[item] }}</span>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import { get } from "@/server/api.js";
export default {
name: 'editField',
props: {
item: {
default: null,
}
},
mounted() {
if (this.item) {
this.handleDetail(this.item)
}
},
data() {
return {
title: '明细记录', //
formHeader: [],
dataDetails: [],
}
},
methods: {
cancel() { //
this.$emit('update:isShowDialog','')
},
/** 明细按钮操作 */
handleDetail(row) {
this.formHeader = [
'PrintDetail-PlantNr',
'PrintDetail-PrintHeadId',
'PrintDetail-Pos',
'PrintDetail-VarName',
'PrintDetail-VarValue',
'PrintDetail-VarType',
'PrintDetail-VarPos',
'PrintDetail-LastModify',
'PrintDetail-LastUser',
'PrintDetail-CreateTime'
]
get('/admin/base/printdetail/query',{printHeadId: row['PrintHead-PrintHeadId']}).then(response => {
this.dataDetails = response.data.records || []
})
},
}
}
</script>

+ 127
- 0
src/views/system/printer/printheadtab/index.vue View File

@ -0,0 +1,127 @@
<template>
<div>
<SearchTemplate>
<el-form :inline="true" class="clearfix search-content">
<el-form-item :label="getColumnName('PrintHead-PrintHeadId')">
<el-input
v-model.trim="queryParams.printheadid"
placeholder="请输入查询内容"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" class="search-button-style" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" class="reset-button-style" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</SearchTemplate>
<ContentContainer>
<el-table :data="tableData" v-loading="loading" size="small" style="width: 100%" border>
<el-table-column v-for="(item, index) in headers" :key="index" :label="getColumnName(item)" :show-overflow-tooltip="true" width="200">
<template #default="scope">
<span v-if="item === 'PrintHead-PlantNr'">{{ getValue(scope.row['PrintHead-PlantNr']) }}</span>
<span v-else-if="item === 'PrintHead-LastModify'"> {{ parseTime(scope.row[item]) }} </span>
<span v-else-if="item === 'PrintHead-CreateTime'"> {{ parseTime(scope.row[item]) }} </span>
<span v-else>{{ scope.row[item] }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="300" fixed="right">
<template #default="scope">
<el-button class="edit-button-style" @click="handleAgain(scope.row)" icon="el-icon-edit" size="small">重打</el-button>
<el-button class="edit-button-style" @click="handleDelete(scope.row)" icon="el-icon-delete" size="small">删除</el-button>
<el-button class="edit-button-style" @click="handleDetail(scope.row)" icon="el-icon-ice-cream-square" size="small">明细</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination v-show="pagination.total>0" v-model:pagination="pagination" @change="getList" />
</ContentContainer>
<AddOrEdit v-if="isShowDialog === 'edit' ? true : false" :item="item" v-model:isShowDialog="isShowDialog" @editCallBack="completeCallBack" />
</div>
</template>
<script>
import { ListMixin } from "@/mixins/ListMixin";
import { put } from "@/server/api.js";
import AddOrEdit from "./addOrEdit.vue";
export default {
components: {
AddOrEdit
},
mixins: [ListMixin],
data() {
return {
pagination: {
//
pageNumber: 1,
_pageSize: 10,
total: 0,
},
queryTableDataUrl: "/admin/base/printhead/query",
headers: [
'PrintHead-PlantNr',
'PrintHead-PrintHeadId',
'PrintHead-PrinterId',
'PrintHead-PrintFileType',
'PrintHead-PrintEventType',
'PrintHead-PrintObjId',
'PrintHead-PrintObjType',
'PrintHead-Status',
'PrintHead-TemplateFile',
'PrintHead-TermId',
'PrintHead-WebAddress',
'PrintHead-PrintCopies',
'PrintHead-PrintedTime',
'PrintHead-PrintedCopies',
'PrintHead-ival1',
'PrintHead-ival2',
'PrintHead-cval1',
'PrintHead-cval2',
'PrintHead-LastModify',
'PrintHead-LastUser',
'PrintHead-CreateTime'
]
};
},
methods: {
//
handleQuery() {
this.pagination.pageNumber = 1
this.getList()
},
//
resetQuery() {
this.queryParams.printheadid = undefined
this.handleQuery()
},
/** 重新打印按钮操作 */
handleAgain(row) {
this.$confirm('是否确认重新打印"' + row['PrintHead-PrintHeadId'] + '"的数据项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
put('/admin/base/printhead/updateone',{
'PrintHead-PlantNr': row['PrintHead-PlantNr'],
'PrintHead-PrintHeadId': row['PrintHead-PrintHeadId'],
'PrintHead-Status': 'R'
}).then(response => {
this.getList()
this.msgSuccess('提交成功')
})
}).catch(function() {})
},
//
handleDelete(row) {
let keyName = row['PrintHead-PrintHeadId']
let deteleUrl = `/admin/base/printhead/deleteone/${row['PrintHead-PrintHeadId']}`
// 12
this.delHanle(keyName, deteleUrl)
},
handleDetail(row) {
this.isShowDialog = "edit"
this.item = row
},
},
};
</script>

Loading…
Cancel
Save