feat(打印):标签补打
This commit is contained in:
parent
a81ef37601
commit
adf9e93da1
10
src/api/mes/print/print-record.js
Normal file
10
src/api/mes/print/print-record.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/router/axios'
|
||||
import {nlv_print} from "@/api/prefix";
|
||||
|
||||
export function fetchList(query) {
|
||||
return request({
|
||||
url: nlv_print('/print-record/page'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
10
src/api/mes/print/print.js
Normal file
10
src/api/mes/print/print.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/router/axios'
|
||||
import {nlv_print} from "@/api/prefix";
|
||||
|
||||
export function reprint(printRecordHandle) {
|
||||
return request({
|
||||
url: nlv_print('/print/reprint?printRecordHandle=' + printRecordHandle),
|
||||
method: 'post',
|
||||
data: {}
|
||||
})
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="execution">
|
||||
<input-select-dialog
|
||||
:modal-obj="shopOrderDialogObj"
|
||||
:modal-obj="shopOrderDialogObj"p
|
||||
:modal-fetch-fun="shopOrderDialogFetchFun"
|
||||
:before-loading-fun="changeShopOrderType"
|
||||
:modal-show.sync="shopOrderDialogVisible"
|
||||
|
||||
361
src/views/mes/print/reprint/index.vue
Normal file
361
src/views/mes/print/reprint/index.vue
Normal file
@ -0,0 +1,361 @@
|
||||
<template>
|
||||
<div class="basic-container-custom">
|
||||
<input-select-dialog
|
||||
:modal-obj="shopOrderDialogObj"
|
||||
:modal-fetch-fun="shopOrderDialogFetchFun"
|
||||
:modal-show.sync="shopOrderDialogVisible"
|
||||
@inputDialogSelected="shopOrderSelected"
|
||||
></input-select-dialog>
|
||||
<input-select-dialog
|
||||
:modal-obj="operationDialogObj"
|
||||
:modal-fetch-fun="operationDialogFetchFun"
|
||||
:modal-show.sync="operationDialogVisible"
|
||||
@inputDialogSelected="operationSelected"
|
||||
></input-select-dialog>
|
||||
<div class="flex-content">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<el-form-item
|
||||
label="工单号"
|
||||
label-suffix=":"
|
||||
prop="shopOrder"
|
||||
>
|
||||
<el-input v-model="queryParams.shopOrder" size="small" @keyup.enter.native="handleQuery">
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showShopOrderDialog"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="工序"
|
||||
label-suffix=":"
|
||||
prop="operation"
|
||||
>
|
||||
<el-input v-model="queryParams.operation" size="small" @keyup.enter.native="handleQuery">
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showOperationDialog"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="条码号"
|
||||
label-suffix=":"
|
||||
prop="barcodeNumber"
|
||||
>
|
||||
<el-input v-model="queryParams.barcodeNumber" size="small" @keyup.enter.native="handleQuery">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="打印场景"
|
||||
label-suffix=":"
|
||||
prop="barcodeType"
|
||||
>
|
||||
<el-select placeHolder="请选择" v-model="queryParams.barcodeType">
|
||||
<el-option v-for="item in barcodeTypeList" :key="item.value"
|
||||
:label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
|
||||
$t('mes.search')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-delete" @click="resetQuery">{{ $t('mes.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="flex-auto">
|
||||
<el-table ref="searchTable" v-loading="loading" :data="tableData" height="100%" border>
|
||||
<el-table-column
|
||||
label="条码号"
|
||||
align="center"
|
||||
prop="barcodeNumber"
|
||||
width="130"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印场景"
|
||||
align="center"
|
||||
prop="barcodeType"
|
||||
width="100"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ formatBarcodeType(scope.row.barcodeType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="工序"
|
||||
align="center"
|
||||
prop="operation"
|
||||
width="auto"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="工单号"
|
||||
align="center"
|
||||
prop="shopOrder"
|
||||
width="auto"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印次数"
|
||||
align="center"
|
||||
prop="printTimes"
|
||||
width="auto"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印份数"
|
||||
align="center"
|
||||
prop="copies"
|
||||
width="auto"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印模板"
|
||||
align="center"
|
||||
prop="printTmpl"
|
||||
width="auto"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印机名称"
|
||||
align="center"
|
||||
prop="printerName"
|
||||
width="auto"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印内容"
|
||||
align="center"
|
||||
prop="printContent"
|
||||
width="auto"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="打印时间"
|
||||
align="center"
|
||||
prop="lastPrintTime"
|
||||
:render-header="(h, { column, $index }) => renderSpecNameHeader(h, { column, $index }, options)"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column :label="$t('crud.menu')" align="center" width="70" class-name="small-padding">
|
||||
<template slot-scope="scope">
|
||||
<!-- 补打 -->
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="handleReprint(scope.row)"
|
||||
>补打
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from 'vuex'
|
||||
import {isBlank} from '@/util/string'
|
||||
import {copyJSON} from '@/util/util'
|
||||
import {initForm, initQueryParam, barcodeTypeList} from '@/views/mes/print/reprint/init'
|
||||
import {renderSpecNameHeader, clear} from '@/components/table-header-pop/render'
|
||||
import {fetchList} from '@/api/mes/print/print-record'
|
||||
import {reprint} from '@/api/mes/print/print'
|
||||
import {hideLoading, showLoading} from "@/const/loading";
|
||||
import {releaseFetchList} from "@/api/mes/prd/shop-order";
|
||||
import {
|
||||
operationDialogObj
|
||||
} from '@/views/mes/pod/init'
|
||||
import {findOperationList as fetchOperationList} from "@/api/mes/prd/operation";
|
||||
|
||||
export default {
|
||||
name: 'unit-basis',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
barcodeTypeList,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 已办任务列表数据
|
||||
tableData: [],
|
||||
title: '标签补打',
|
||||
// 弹出层显示标识
|
||||
visible: false,
|
||||
// 弹出层标题
|
||||
showTitle: '',
|
||||
// 弹出层状态
|
||||
state: '',
|
||||
// 是否显示弹出层
|
||||
open: '',
|
||||
src: '',
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: copyJSON(initQueryParam),
|
||||
// 表单参数
|
||||
form: copyJSON(initForm),
|
||||
// 表单校验
|
||||
rules: {},
|
||||
isBlank,
|
||||
renderSpecNameHeader,
|
||||
options: {
|
||||
refresh: this.refresh,
|
||||
visible: true,
|
||||
property: {
|
||||
lastPrintTime: {
|
||||
type: 'datetime',
|
||||
}
|
||||
},
|
||||
},
|
||||
orderJson: JSON.stringify([{column: 'LAST_PRINT_TIME', asc: false}]),
|
||||
operationDialogVisible: false,
|
||||
shopOrderDialogFetchFun: releaseFetchList,
|
||||
shopOrderDialogObj: {
|
||||
title: '工单',
|
||||
condition: 'shopOrder',
|
||||
tableColumn: [
|
||||
{
|
||||
prop: 'shopOrder',
|
||||
label: 'mes.shopOrderNo',
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: 'mes.ord.status',
|
||||
},
|
||||
{
|
||||
prop: 'qty',
|
||||
label: 'mes.qtyToBuild',
|
||||
},
|
||||
],
|
||||
queryParam: {},
|
||||
},
|
||||
shopOrderDialogVisible: false,
|
||||
operationDialogObj,
|
||||
operationDialogFetchFun: fetchOperationList,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['permissions']),
|
||||
permissionList() {
|
||||
return {}
|
||||
},
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next((vm) => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
showShopOrderDialog() {
|
||||
if (!this.shopOrderDisabled) {
|
||||
this.shopOrderDialogVisible = true
|
||||
this.shopOrderDialogObj.queryParam.status = 'RELEASABLE'
|
||||
}
|
||||
},
|
||||
//显示操作弹窗框
|
||||
showOperationDialog() {
|
||||
this.operationDialogVisible = true
|
||||
},
|
||||
shopOrderSelected(row) {
|
||||
let me = this
|
||||
me.queryParams.shopOrder = row.shopOrder
|
||||
},
|
||||
operationSelected(row) {
|
||||
let me = this
|
||||
me.queryParams.operation = row.operation
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
// this.queryParams.orderJson = this.orderJson
|
||||
let params = this.addDateRange(this.queryParams, this.dateRange);
|
||||
fetchList(Object.assign(
|
||||
{
|
||||
orderJson: isBlank(this.orderJson) ? [] : this.orderJson,
|
||||
},
|
||||
params
|
||||
))
|
||||
.then((response) => {
|
||||
this.tableData = response.data.data.records
|
||||
this.total = parseInt(response.data.data.total)
|
||||
this.loading = false
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
formatBarcodeType(barcodeType) {
|
||||
for (let i = 0; i < this.barcodeTypeList.length; i++) {
|
||||
if (barcodeType === this.barcodeTypeList[i].value) {
|
||||
return this.barcodeTypeList[i].label
|
||||
}
|
||||
}
|
||||
return barcodeType
|
||||
},
|
||||
handleReprint(row) {
|
||||
this.$confirm('是否执行补打', '提示', {
|
||||
confirmButtonText: this.$t('common.confirm'),
|
||||
cancelButtonText: this.$t('common.cancel'),
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
showLoading()
|
||||
reprint(row.handle)
|
||||
.then((response) => {
|
||||
this.$message.success("补打成功");
|
||||
this.getList()
|
||||
hideLoading()
|
||||
})
|
||||
.catch(() => {
|
||||
hideLoading()
|
||||
})
|
||||
})
|
||||
},
|
||||
refresh(params) {
|
||||
this.queryParams = Object.assign({}, this.queryParams, params)
|
||||
this.handleQuery()
|
||||
},
|
||||
clearValue(key) {
|
||||
this.queryParams[key] = ''
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.current = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
clear.call(this, this.$refs.searchTable)
|
||||
this.queryParams = copyJSON(initQueryParam)
|
||||
this.handleQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
34
src/views/mes/print/reprint/init.js
Normal file
34
src/views/mes/print/reprint/init.js
Normal file
@ -0,0 +1,34 @@
|
||||
export const initQueryParam = {
|
||||
current: 1,
|
||||
size: 20,
|
||||
shopOrder: '',
|
||||
barcodeNumber: '',
|
||||
barcodeType: '',
|
||||
operation: ''
|
||||
}
|
||||
|
||||
export const initForm = {
|
||||
shopOrder: '',
|
||||
barcodeNumber: '',
|
||||
barcodeType: '',
|
||||
operation: ''
|
||||
}
|
||||
|
||||
export const barcodeTypeList = [
|
||||
{
|
||||
'value': 'operation',
|
||||
'label': '工序打印'
|
||||
},
|
||||
{
|
||||
'value': 'barcode',
|
||||
'label': '条码补打印'
|
||||
},
|
||||
{
|
||||
'value': 'package',
|
||||
'label': '包装批次打印'
|
||||
},
|
||||
{
|
||||
'value': 'tool',
|
||||
'label': '物流载具打印'
|
||||
}
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user