包装40%
This commit is contained in:
45
src/views/base/packagingPrintLog2/components/InputArea.vue
Normal file
45
src/views/base/packagingPrintLog2/components/InputArea.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<div class="tableInner">
|
||||
<el-input
|
||||
v-if="list.isEdit"
|
||||
type="number"
|
||||
v-model="list[itemProp]"
|
||||
@blur="changeInput" />
|
||||
<span v-else>{{ list[itemProp] }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'InputArea',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
itemProp: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
watch: {
|
||||
injectData() {
|
||||
this.initData();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.list = this.injectData;
|
||||
},
|
||||
changeInput() {
|
||||
this.$emit('emitData', this.list);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
226
src/views/base/packagingPrintLog2/components/OtherMsg.vue
Normal file
226
src/views/base/packagingPrintLog2/components/OtherMsg.vue
Normal file
@@ -0,0 +1,226 @@
|
||||
<template>
|
||||
<div class="other-msg-box">
|
||||
<el-radio-group
|
||||
v-model="chooseMsg"
|
||||
@change="changeChoose">
|
||||
<el-radio :label="1">
|
||||
<div style="display: inline-block">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="printMsg1"
|
||||
class="demo-form-inline">
|
||||
<el-form-item label="客户">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="printMsg1.customerId"
|
||||
filterable
|
||||
placeholder="客户">
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="封箱人员工号">
|
||||
<el-input
|
||||
v-model="printMsg1.sealWorker"
|
||||
size="small"
|
||||
placeholder="封箱人员工号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="打包人员工号">
|
||||
<el-input
|
||||
v-model="printMsg1.packWorker"
|
||||
size="small"
|
||||
placeholder="打包人员工号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程卡号">
|
||||
<el-input
|
||||
v-model="printMsg1.processCard"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
placeholder="流程卡号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘规格">
|
||||
<el-input
|
||||
v-model="printMsg1.pallet"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
placeholder="托盘规格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="printMsg1.remark"
|
||||
size="small"
|
||||
placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-radio>
|
||||
<el-radio :label="2">
|
||||
<div style="display: inline-block">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="printMsg2"
|
||||
class="demo-form-inline">
|
||||
<el-form-item label="客户">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="printMsg2.customerId"
|
||||
filterable
|
||||
placeholder="客户">
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="封箱人员工号">
|
||||
<el-input
|
||||
v-model="printMsg2.sealWorker"
|
||||
size="small"
|
||||
placeholder="封箱人员工号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="打包人员工号">
|
||||
<el-input
|
||||
v-model="printMsg2.packWorker"
|
||||
size="small"
|
||||
placeholder="打包人员工号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程卡号">
|
||||
<el-input
|
||||
v-model="printMsg2.processCard"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
placeholder="流程卡号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘规格">
|
||||
<el-input
|
||||
v-model="printMsg2.pallet"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
placeholder="托盘规格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="printMsg2.remark"
|
||||
size="small"
|
||||
placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-radio>
|
||||
<el-radio :label="3">
|
||||
<div style="display: inline-block">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="printMsg3"
|
||||
class="demo-form-inline">
|
||||
<el-form-item label="客户">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="printMsg3.customerId"
|
||||
filterable
|
||||
placeholder="客户">
|
||||
<el-option
|
||||
v-for="item in customerList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="封箱人员工号">
|
||||
<el-input
|
||||
v-model="printMsg3.sealWorker"
|
||||
size="small"
|
||||
placeholder="封箱人员工号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="打包人员工号">
|
||||
<el-input
|
||||
v-model="printMsg3.packWorker"
|
||||
size="small"
|
||||
placeholder="打包人员工号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程卡号">
|
||||
<el-input
|
||||
v-model="printMsg3.processCard"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
placeholder="流程卡号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘规格">
|
||||
<el-input
|
||||
v-model="printMsg3.pallet"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
placeholder="托盘规格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="printMsg3.remark"
|
||||
size="small"
|
||||
placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getCustomerList } from '@/api/base/packingInfo';
|
||||
export default {
|
||||
name: 'OtherMsg',
|
||||
props: {
|
||||
printMsg1: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
printMsg2: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
printMsg3: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chooseMsg: 1,
|
||||
customerList: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getCList();
|
||||
},
|
||||
methods: {
|
||||
getCList() {
|
||||
getCustomerList().then((res) => {
|
||||
console.log(res);
|
||||
console.log('customer');
|
||||
this.customerList = res.data;
|
||||
});
|
||||
},
|
||||
changeChoose(val) {
|
||||
this.$emit('changeChoose', val);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.other-msg-box {
|
||||
.el-radio {
|
||||
display: block;
|
||||
line-height: 36px;
|
||||
.demo-form-inline {
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
}
|
||||
.el-form-item {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
182
src/views/base/packagingPrintLog2/components/Printed.vue
Normal file
182
src/views/base/packagingPrintLog2/components/Printed.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<div class="show-box">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick2" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams2.pageNo"
|
||||
:limit="queryParams2.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list2">
|
||||
<method-btn
|
||||
v-if="tableBtn2.length"
|
||||
slot="handleBtn"
|
||||
:width="240"
|
||||
label="操作"
|
||||
:method-list="tableBtn2"
|
||||
@clickBtn="handleClick2" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams2.pageNo"
|
||||
:limit.sync="queryParams2.pageSize"
|
||||
:total="total2"
|
||||
@pagination="getList2" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { getPackingPage } from '@/api/base/packingInfo';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'packagingCode',
|
||||
label: '成品周转编号',
|
||||
minWidth: 180,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'lineId',
|
||||
label: '产线',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '规格',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'check',
|
||||
label: '判定',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'workStation',
|
||||
label: '工位号',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '片数',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注1',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'printStatus',
|
||||
label: '打印状态',
|
||||
filter: (val) => (val == 1 ? '未打印' : '已打印'),
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'groupClass',
|
||||
label: '班次',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'Printed',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams2: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
printStatus: '2',
|
||||
lineId: '',
|
||||
createTime: [],
|
||||
},
|
||||
total2: 0,
|
||||
tableProps,
|
||||
list2: [],
|
||||
tableBtn2: [
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'reprint',
|
||||
btnName: '重打',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:query')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order-group:update',
|
||||
'base:core-product:query',
|
||||
'base:core-customer:query',
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getLineList();
|
||||
},
|
||||
methods: {
|
||||
getLineList() {
|
||||
getCorePLList().then((res) => {
|
||||
console.log(res);
|
||||
this.formConfig[0].selectOptions = res.data;
|
||||
});
|
||||
},
|
||||
getList2() {
|
||||
getPackingPage({ ...this.queryParams2 }).then((res) => {
|
||||
console.log(res);
|
||||
this.list2 = res.data.records || [];
|
||||
this.total2 = res.data.total;
|
||||
});
|
||||
},
|
||||
buttonClick2(val) {
|
||||
console.log(val);
|
||||
this.queryParams2.lineId = val.lineId;
|
||||
this.queryParams2.createTime = val.timeVal;
|
||||
this.getList2();
|
||||
},
|
||||
handleClick2() {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
332
src/views/base/packagingPrintLog2/components/UnPrint.vue
Normal file
332
src/views/base/packagingPrintLog2/components/UnPrint.vue
Normal file
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<div class="show-box">
|
||||
<!-- 单选 -->
|
||||
<other-msg
|
||||
:printMsg1="printMsg1"
|
||||
:printMsg2="printMsg2"
|
||||
:printMsg3="printMsg3"
|
||||
@changeChoose="changeChoose" />
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
@emitFun="inputChange">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="260"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
<!-- 预览 -->
|
||||
<print-preview ref="preView" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import inputArea from './InputArea.vue';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'packagingCode',
|
||||
label: '成品周转编号',
|
||||
minWidth: 160,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'lineId',
|
||||
label: '产线',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '规格',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'check',
|
||||
label: '判定',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'workStation',
|
||||
label: '工位号',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '片数',
|
||||
subcomponent: inputArea,
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注1',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'printStatus',
|
||||
label: '打印状态',
|
||||
filter: (val) => (val == 1 ? '未打印' : '已打印'),
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'groupClass',
|
||||
label: '班次',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
import OtherMsg from './OtherMsg';
|
||||
import { getPackingPage, updatePacking } from '@/api/base/packingInfo';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
import printPreview from './preview';
|
||||
import printTemplate from '../print-template';
|
||||
export default {
|
||||
name: 'UnPrint',
|
||||
components: { OtherMsg, printPreview },
|
||||
data() {
|
||||
return {
|
||||
printMsg1: {
|
||||
customerId: '',
|
||||
sealWorker: '',
|
||||
packWorker: '',
|
||||
processCard: '',
|
||||
pallet: '',
|
||||
remark: '',
|
||||
},
|
||||
printMsg2: {
|
||||
customerId: '',
|
||||
sealWorker: '',
|
||||
packWorker: '',
|
||||
processCard: '',
|
||||
pallet: '',
|
||||
remark: '',
|
||||
},
|
||||
printMsg3: {
|
||||
customerId: '',
|
||||
sealWorker: '',
|
||||
packWorker: '',
|
||||
processCard: '',
|
||||
pallet: '',
|
||||
remark: '',
|
||||
},
|
||||
chooseMsg: 1, //单选
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
printStatus: '1',
|
||||
lineId: '',
|
||||
createTime: [],
|
||||
},
|
||||
total: 0,
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'base:order-con-group-order:create',
|
||||
])
|
||||
? {
|
||||
type: 'view',
|
||||
btnName: '预览',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'print',
|
||||
btnName: '打印',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'printed',
|
||||
btnName: '已打印',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order-group:update',
|
||||
'base:core-product:query',
|
||||
'base:core-customer:query',
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'unequal',
|
||||
name: 'isEdit',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order-group:update',
|
||||
'base:core-product:query',
|
||||
'base:core-customer:query',
|
||||
])
|
||||
? {
|
||||
type: 'save',
|
||||
btnName: '保存',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'isEdit',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:query')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
printData: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getLineList();
|
||||
console.log(printTemplate);
|
||||
console.log('================printTemplate');
|
||||
},
|
||||
methods: {
|
||||
getLineList() {
|
||||
getCorePLList().then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data;
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
getPackingPage({ ...this.queryParams }).then((res) => {
|
||||
this.list = res.data.records || [];
|
||||
this.total = res.data.total;
|
||||
});
|
||||
},
|
||||
// 单选
|
||||
changeChoose(val) {
|
||||
this.chooseMsg = val;
|
||||
},
|
||||
buttonClick(val) {
|
||||
this.queryParams.lineId = val.lineId;
|
||||
this.queryParams.createTime = val.timeVal;
|
||||
this.getList();
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.editNum(val.data);
|
||||
break;
|
||||
case 'save':
|
||||
this.saveNum(val.data);
|
||||
break;
|
||||
case 'view':
|
||||
this.preView();
|
||||
break;
|
||||
case 'print':
|
||||
this.printTemp();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
// 编辑
|
||||
editNum(val) {
|
||||
let obj = this.list[val._pageIndex - 1];
|
||||
obj.isEdit = true;
|
||||
this.$set(this.list, val._pageIndex - 1, obj);
|
||||
},
|
||||
// 保存
|
||||
saveNum(val) {
|
||||
// 调用修改接口
|
||||
updatePacking({ id: val.id, num: val.num }).then(() => {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
// 输入框改变num
|
||||
inputChange(val) {
|
||||
this.list[val._pageIndex - 1][val.prop] = val[val.prop];
|
||||
},
|
||||
// 预览
|
||||
preView() {
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: printTemplate,
|
||||
});
|
||||
this.$refs.preView.show(hiprintTemplate);
|
||||
},
|
||||
// 打印
|
||||
printTemp() {
|
||||
console.log('11');
|
||||
var printData = {};
|
||||
let hiprintTemplate = this.$print(
|
||||
undefined,
|
||||
printTemplate,
|
||||
printData,
|
||||
{},
|
||||
{
|
||||
styleHandler: () => {
|
||||
let css =
|
||||
'<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">';
|
||||
return css;
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log(hiprintTemplate);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
69
src/views/base/packagingPrintLog2/components/UnPrintEdit.vue
Normal file
69
src/views/base/packagingPrintLog2/components/UnPrintEdit.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="unPrintEdit"
|
||||
:rules="rules"
|
||||
label-width="130px"
|
||||
:model="form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="成品周转编号"
|
||||
prop="packagingCode">
|
||||
<el-input
|
||||
readonly
|
||||
v-model="form.packagingCode"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="片数"
|
||||
prop="num">
|
||||
<el-input-number
|
||||
v-model="form.num"
|
||||
:min="0"
|
||||
:max="999999"
|
||||
style="width: 100%"
|
||||
label="片数"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getPacking } from '@/api/base/packingInfo';
|
||||
export default {
|
||||
name: 'UnPrintEdit',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
packagingCode: '',
|
||||
num: null,
|
||||
},
|
||||
rules: {
|
||||
num: [{ required: true, message: '片数不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
console.log('init');
|
||||
this.form.id = id;
|
||||
getPacking(id).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['unPrintEdit'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log('保存');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.unPrintEdit.resetFields();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
100
src/views/base/packagingPrintLog2/components/preview.vue
Normal file
100
src/views/base/packagingPrintLog2/components/preview.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<base-dialog
|
||||
dialogTitle="预览"
|
||||
:dialogVisible="visible"
|
||||
width="50%"
|
||||
@cancel="hideModal"
|
||||
:before-close="hideModal">
|
||||
<!-- <div>
|
||||
<el-button
|
||||
:loading="waitShowPrinter"
|
||||
type="primary"
|
||||
icon="printer"
|
||||
@click.stop="print">
|
||||
打印
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="printer"
|
||||
@click.stop="toPdf">
|
||||
pdf
|
||||
</el-button>
|
||||
</div> -->
|
||||
<div id="preview_content" />
|
||||
<template slot="footer">
|
||||
<el-button
|
||||
key="close"
|
||||
@click="hideModal">
|
||||
关闭
|
||||
</el-button>
|
||||
</template>
|
||||
</base-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PrintPreview',
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
spinning: true,
|
||||
waitShowPrinter: false,
|
||||
// 纸张宽 mm
|
||||
width: 0,
|
||||
// 模板
|
||||
hiprintTemplate: {},
|
||||
// 数据
|
||||
printData: {},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
hideModal() {
|
||||
this.visible = false;
|
||||
},
|
||||
show(hiprintTemplate, printData, width = '210') {
|
||||
this.visible = true;
|
||||
this.spinning = true;
|
||||
this.width = width;
|
||||
this.hiprintTemplate = hiprintTemplate;
|
||||
this.printData = printData;
|
||||
console.log(hiprintTemplate);
|
||||
console.log(printData);
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
$('#preview_content').html(hiprintTemplate.getHtml(printData));
|
||||
this.spinning = false;
|
||||
}, 500);
|
||||
},
|
||||
print() {
|
||||
this.waitShowPrinter = true;
|
||||
this.hiprintTemplate.print(
|
||||
this.printData,
|
||||
{},
|
||||
{
|
||||
callback: () => {
|
||||
console.log('callback');
|
||||
this.waitShowPrinter = false;
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
toPdf() {
|
||||
this.hiprintTemplate.toPdf({}, '打印预览');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<!-- <style lang="less" scoped>
|
||||
/deep/ .ant-modal-body {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/deep/ .ant-modal-content {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
</style> -->
|
||||
Reference in New Issue
Block a user