init
This commit is contained in:
208
src/views/packing-manage/LabelTemplate.vue
Normal file
208
src/views/packing-manage/LabelTemplate.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<div :class="$style.container">
|
||||
<SearchBar
|
||||
:placeholder="$t('module.packingManage.labelTemplate.placeholderSearch')"
|
||||
:input-width="200"
|
||||
@on-search="handleSearch"
|
||||
>
|
||||
<el-button type="success" icon="el-icon-plus" @click="handleAdd()">
|
||||
{{ "btn.add" | i18nFilter }}
|
||||
</el-button>
|
||||
</SearchBar>
|
||||
<el-table
|
||||
:data="tableDataList"
|
||||
:class="$style.table"
|
||||
:stripe="true"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266',height: '56px'}"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
size="medium"
|
||||
>
|
||||
<el-table-column prop="index" :label="'tableHeader.index' | i18nFilter" width="80" fixed="left" align="center" />
|
||||
<el-table-column prop="createTime" :label="$t('module.packingManage.labelTemplate.addTime')" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ moment(scope.row.handoverTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" :label="$t('module.packingManage.labelTemplate.labelCode')" width="180" align="center" />
|
||||
<el-table-column prop="name" :label="$t('module.packingManage.labelTemplate.labelName')" width="180" align="center" />
|
||||
<el-table-column prop="type" :label="$t('module.packingManage.labelTemplate.labelType')" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ printModelTypeList[scope.row.type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="content"
|
||||
:label="$t('module.packingManage.labelTemplate.labelContent')"
|
||||
width="180"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column prop="remark" align="center" :label="$t('module.packingManage.labelTemplate.remark')" />
|
||||
<el-table-column :label="'tableHeader.operation' | i18nFilter" align="center" width="320" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
>
|
||||
{{ "btn.view" | i18nFilter }}
|
||||
</el-button>
|
||||
<span style="margin:0 3px">|</span>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="info"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row.id)"
|
||||
>
|
||||
{{ "btn.edit" | i18nFilter }}
|
||||
</el-button>
|
||||
<span style="margin:0 3px">|</span>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>
|
||||
{{ "btn.delete" | i18nFilter }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
background
|
||||
:hide-on-single-page="false"
|
||||
:class="$style.table"
|
||||
:current-page="page.current"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="page.size"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="pageTotal"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
import { page, del } from '@/api/packing-manage/packing-label.js'
|
||||
import SearchBar from '@/views/art/components/search-bar'
|
||||
import i18n from '@/lang'
|
||||
import { getLodop } from '@/assets/libs/LodopFuncs.js'
|
||||
|
||||
const printModelTypeList = {
|
||||
0: i18n.t('module.packingManage.labelTemplate.levelLabel'),
|
||||
1: i18n.t('module.packingManage.labelTemplate.moduleLabel'),
|
||||
2: i18n.t('module.packingManage.labelTemplate.custom')
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { SearchBar },
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
tableDataList: [],
|
||||
pageTotal: 0,
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
param: {},
|
||||
printModelTypeList
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.handleSearch()
|
||||
},
|
||||
methods: {
|
||||
handleSearch(param) {
|
||||
this.param = param
|
||||
console.log(param)
|
||||
page({ ...param, key: param && param.keywords, ...this.page }).then(
|
||||
res => {
|
||||
if (!res.data) {
|
||||
return
|
||||
}
|
||||
this.pageTotal = res.data && res.data.total
|
||||
console.log(this.pageTotal)
|
||||
if (!res.data.records) {
|
||||
this.tableDataList = []
|
||||
return
|
||||
}
|
||||
this.tableDataList = res.data.records.map((m, index) => ({
|
||||
...m,
|
||||
index: this.page.size * (this.page.current - 1) + index + 1
|
||||
}))
|
||||
}
|
||||
)
|
||||
},
|
||||
handleAdd() {
|
||||
this.$router.push({
|
||||
path: '/packing/label-design-add',
|
||||
query: {
|
||||
redirect: '/packing/label-template',
|
||||
title: '标签设计'
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEdit(id) {
|
||||
this.$router.push({
|
||||
path: '/packing/label-design-add',
|
||||
query: {
|
||||
redirect: '/packing/label-template',
|
||||
title: '标签设计',
|
||||
id
|
||||
}
|
||||
})
|
||||
},
|
||||
handleView(printModel) {
|
||||
const LODOP = getLodop()
|
||||
const modelCode = printModel.content
|
||||
LODOP.ADD_PRINT_DATA('ProgramData', modelCode) // 装载模板
|
||||
// 按类名赋值
|
||||
LODOP.SET_PRINT_STYLEA('name', 'CONTENT', '张三')
|
||||
LODOP.SET_PRINT_STYLEA('code', 'CONTENT', '123455')
|
||||
LODOP.PREVIEW()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
this.page.size = val
|
||||
this.handleSearch(this.param)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
this.page.current = val
|
||||
this.handleSearch(this.param)
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm(
|
||||
i18n.t('deleteMsgBox.content'),
|
||||
i18n.t('deleteMsgBox.hint'),
|
||||
{
|
||||
confirmButtonText: i18n.t('btn.confirm'),
|
||||
cancelButtonText: i18n.t('btn.cancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
).then(async() => {
|
||||
del({ id }).then(res => {
|
||||
this.page.current = 1
|
||||
this.handleSearch(this.param)
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: i18n.t('deleteMsgBox.doneMsg')
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" module>
|
||||
.container {
|
||||
.table {
|
||||
margin: 16px;
|
||||
width: 98.5%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
162
src/views/packing-manage/PackingList.vue
Normal file
162
src/views/packing-manage/PackingList.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-02-27 14:39:57
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2021-07-26 14:32:19
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div style="margin-top:30px">
|
||||
<el-form
|
||||
ref="formData"
|
||||
:model="formData"
|
||||
:inline="true"
|
||||
size="medium"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item :label="$t('module.packingManage.PackingList.WorkOrderNo')" prop="workOrderNo">
|
||||
<el-input v-model="formData.workOrderNo" :placeholder="$i18nForm(['placeholder.input', this.$t('module.packingManage.PackingList.WorkOrderNo')])" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="boxID" prop="id">
|
||||
<el-input v-model="formData.id" :placeholder="$i18nForm(['placeholder.input', 'boxID'])" style="width:200px" clearable />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('module.packingManage.PackingList.PackingTime')" label-width="100px" prop="time">
|
||||
<el-date-picker
|
||||
v-model="formData.timeSlot"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
:start-placeholder="$t('module.orderManage.order.StartTime')"
|
||||
:end-placeholder="$t('module.orderManage.order.StartTime')"
|
||||
:range-separator="$t('module.orderManage.order.To')"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getList()"> {{ 'btn.search' | i18nFilter }} </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<base-table
|
||||
:page="formData.current"
|
||||
:limit="formData.size"
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
:is-loading="listLoading"
|
||||
/>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="formData.current"
|
||||
:limit.sync="formData.size"
|
||||
@pagination="getList()"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/lang'
|
||||
import { packagingInventoryList } from '@/api/orderManage/workOrder/workOrder'
|
||||
// import { timeFormatter } from '@/filters'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import detailBtn from './components/detailBtn'
|
||||
import Pagination from '@/components/Pagination'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'id',
|
||||
label: 'boxID',
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// prop: 'PackingTime',
|
||||
// label: i18n.t('module.packingManage.PackingList.PackingTime'),
|
||||
// align: 'center',
|
||||
// filter: timeFormatter
|
||||
// },
|
||||
{
|
||||
prop: 'workOrderNo',
|
||||
label: i18n.t('module.packingManage.PackingList.WorkOrderNo'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'totalPower',
|
||||
label: 'TotalPower',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'substrateQuantity',
|
||||
label: i18n.t('module.packingManage.PackingList.SubstrateNumber'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'grade',
|
||||
label: i18n.t('module.packingManage.PackingList.QualityGrade'),
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'Detail',
|
||||
label: i18n.t('module.packingManage.PackingList.Detail'),
|
||||
subcomponent: detailBtn
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: '',
|
||||
filters: {
|
||||
commonFilter: (source, filterType = a => a) => {
|
||||
return filterType(source)
|
||||
}
|
||||
},
|
||||
components: { BaseTable, Pagination },
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: false,
|
||||
formData: {
|
||||
workOrderNo: '',
|
||||
id: '',
|
||||
timeSlot: [],
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
current: 1,
|
||||
size: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['formData'].resetFields()
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
if (this.formData.timeSlot) {
|
||||
this.formData.startTime = this.formData.timeSlot[0]
|
||||
this.formData.endTime = this.formData.timeSlot[1]
|
||||
} else {
|
||||
this.formData.startTime = ''
|
||||
this.formData.endTime = ''
|
||||
}
|
||||
this.listLoading = true
|
||||
packagingInventoryList(this.formData).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.total = response.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
261
src/views/packing-manage/components/AddLablePanel.vue
Normal file
261
src/views/packing-manage/components/AddLablePanel.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div :class="$style.container">
|
||||
<HeaderTitleBar>
|
||||
<div slot="content">
|
||||
<el-button type="success" @click="btnClickDesign">
|
||||
①{{ $t('module.packingManage.labelTemplate.templateDesign') }}
|
||||
</el-button>
|
||||
<el-button icon="ios-search" @click="btnClickPrint">
|
||||
{{ $t('module.packingManage.labelTemplate.templatePreview') }}
|
||||
</el-button>
|
||||
<!-- <el-button icon="md-help" @click="btnClickInfo">
|
||||
设计说明
|
||||
</el-button> -->
|
||||
</div>
|
||||
</HeaderTitleBar>
|
||||
<el-form
|
||||
ref="printModel"
|
||||
:model="printModel"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
:class="$style.form"
|
||||
>
|
||||
<el-form-item :label="$t('module.packingManage.labelTemplate.labelCode')" prop="code" :class="$style['form-item']">
|
||||
<el-input v-model="printModel.code" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.packingManage.labelTemplate.labelName')" prop="name" :class="$style['form-item']">
|
||||
<el-input v-model="printModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('module.packingManage.labelTemplate.labelType')" prop="type" :class="$style['form-item']">
|
||||
<el-select
|
||||
v-model="printModel.type"
|
||||
:class="$style.select"
|
||||
filterable
|
||||
clearable
|
||||
:placeholder="$t('module.packingManage.labelTemplate.labelType')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in printModelTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('module.packingManage.labelTemplate.labelContent')"
|
||||
prop="content"
|
||||
:class="$style['form-item-remark']"
|
||||
>
|
||||
<el-input
|
||||
v-model="content"
|
||||
:readonly="false"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('module.packingManage.labelTemplate.remark')"
|
||||
prop="remark"
|
||||
:class="$style['form-item-remark']"
|
||||
>
|
||||
<el-input
|
||||
v-model="printModel.remark"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<SubmitBar @on-cancle="close()" @on-submit="handleSubmit('printModel')" />
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { find } from 'lodash'
|
||||
import { list } from '@/api/material-manage/material'
|
||||
import { add, getInfo, update } from '@/api/packing-manage/packing-label.js'
|
||||
import SubmitBar from '@/views/art/components/submit-bar'
|
||||
import HeaderTitleBar from '@/views/material-manage/components/header-title-bar'
|
||||
import { getLodop } from '@/assets/libs/LodopFuncs.js'
|
||||
import i18n from '@/lang'
|
||||
|
||||
const printModelTypeList = [
|
||||
{
|
||||
id: 0,
|
||||
name: i18n.t('module.packingManage.labelTemplate.levelLabel')
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: i18n.t('module.packingManage.labelTemplate.moduleLabel')
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: i18n.t('module.packingManage.labelTemplate.custom')
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'AddLabelPanel',
|
||||
components: {
|
||||
SubmitBar,
|
||||
HeaderTitleBar
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
printModel: {
|
||||
id: '',
|
||||
code: '',
|
||||
name: '',
|
||||
content: '',
|
||||
type: 1,
|
||||
isDefault: 0,
|
||||
isPreview: 1,
|
||||
state: 'normal',
|
||||
remark: ''
|
||||
},
|
||||
printModelTypeList,
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.packingManage.labelTemplate.labelCode')]), trigger: 'blur' },
|
||||
{ min: 1, message: this.$t('module.packingManage.labelTemplate.placeholderLength'), trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.packingManage.labelTemplate.labelName')]), trigger: 'blur' },
|
||||
{ min: 1, message: this.$t('module.packingManage.labelTemplate.placeholderLength'), trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$i18nForm(['placeholder.select', this.$t('module.packingManage.labelTemplate.labelType')]),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: this.$i18nForm(['placeholder.input', this.$t('module.packingManage.labelTemplate.labelContent')]), trigger: 'blur' },
|
||||
{ min: 1, message: this.$t('module.packingManage.labelTemplate.placeholderLength'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
id: null
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.id = this.$route.query.id
|
||||
console.log(this.id)
|
||||
console.log(!this.id)
|
||||
list().then(res => {
|
||||
console.log(res)
|
||||
this.materialList = res.data
|
||||
})
|
||||
if (this.id) {
|
||||
getInfo({ id: this.id }).then(res => {
|
||||
console.log(res)
|
||||
this.printModel = res.data
|
||||
this.materialCode = this.printModel.materialCode
|
||||
this.content = this.printModel.content
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSubmit(formName) {
|
||||
console.log('handleSubmit')
|
||||
this.$refs[formName].validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
if (this.id) {
|
||||
update(this.printModel).then(res => {
|
||||
this.close()
|
||||
})
|
||||
} else {
|
||||
add(this.printModel).then(res => {
|
||||
this.close()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$router.push({ path: this.$route.query.redirect })
|
||||
},
|
||||
materialChange(item) {
|
||||
const material = find(this.materialList, m => m.id === item)
|
||||
this.materialCode = material && material.externalCode
|
||||
},
|
||||
btnClickDesign() {
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT('初始化打印')
|
||||
LODOP.SET_PRINT_MODE('PROGRAM_CONTENT_BYVAR', true) // 生成程序时,内容参数有变量用变量,无变量用具体值
|
||||
LODOP.SET_SHOW_MODE('DESIGN_IN_BROWSE', 1)
|
||||
const modelCode = this.printModel.content
|
||||
LODOP.ADD_PRINT_DATA('ProgramData', modelCode) // 装载模板
|
||||
this.printModel.content = LODOP.PRINT_DESIGN()
|
||||
if (LODOP.CVERSION) {
|
||||
LODOP.On_Return = (TaskID, Value) => {
|
||||
console.log('CVERSION')
|
||||
console.log(Value)
|
||||
this.printModel.content = Value
|
||||
this.content = Value
|
||||
this.getProgramData()
|
||||
}
|
||||
}
|
||||
},
|
||||
getProgramData() {
|
||||
const LODOP = getLodop()
|
||||
console.log('getProgramData')
|
||||
const content = LODOP.GET_VALUE('ProgramData', 0) // 获得文档式模板
|
||||
console.log(content)
|
||||
if (LODOP.CVERSION) {
|
||||
LODOP.On_Return = (TaskID, Value) => {
|
||||
console.log(Value)
|
||||
this.printModel.content = Value
|
||||
}
|
||||
}
|
||||
},
|
||||
btnClickPrint() {
|
||||
const LODOP = getLodop()
|
||||
const modelCode = this.printModel.content
|
||||
LODOP.ADD_PRINT_DATA('ProgramData', modelCode) // 装载模板
|
||||
// 按类名赋值
|
||||
LODOP.SET_PRINT_STYLEA('name', 'CONTENT', '张三')
|
||||
LODOP.SET_PRINT_STYLEA('code', 'CONTENT', '123455')
|
||||
LODOP.PREVIEW()
|
||||
},
|
||||
btnClickInfo() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" module>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.form {
|
||||
width: 60%;
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
.form-item {
|
||||
width: 50%;
|
||||
}
|
||||
.form-item-remark {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.input {
|
||||
display: flex;
|
||||
margin: 8px 16px 8px 4px;
|
||||
align-items: center;
|
||||
.select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
52
src/views/packing-manage/components/detailBtn.vue
Normal file
52
src/views/packing-manage/components/detailBtn.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<!--
|
||||
* @Date: 2021-01-07 20:09:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-07-21 09:05:43
|
||||
* @FilePath:
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<span>
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="btnClickPrint"
|
||||
>{{ "btn.print" | i18nFilter }}</el-button> -->
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="emitClick"
|
||||
>
|
||||
{{ 'routerTitle.order.workOrderManage.tagDetail' | i18nFilter }}
|
||||
</el-button>
|
||||
</span>
|
||||
<tag-detail v-if="tagDetailVisible" ref="tagDetail" :packaging-box-id="injectData.id" :order-code="injectData.workOrderNo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tagDetail from './tagDetail'
|
||||
export default {
|
||||
components: { tagDetail },
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tagDetailVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emitClick() {
|
||||
this.tagDetailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tagDetail.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
203
src/views/packing-manage/components/tagDetail.vue
Normal file
203
src/views/packing-manage/components/tagDetail.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2020-12-29 16:37:56
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2021-07-21 09:30:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:append-to-body="true"
|
||||
:show-close="false"
|
||||
:visible.sync="visible"
|
||||
size="55%"
|
||||
>
|
||||
<div
|
||||
slot="title"
|
||||
style=" background-color:#02BCFF;font-size:1.5em;color:white;padding:5px 20px"
|
||||
>
|
||||
{{ "routerTitle.order.workOrderManage.tagDetail" | i18nFilter }}
|
||||
</div>
|
||||
<div id="tablePrint">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span><b>{{ "BOX_ID:" + dataForm.id }}</b></span>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="float:right"
|
||||
size="small"
|
||||
@click="btnClickPrint"
|
||||
>{{ "btn.print" | i18nFilter }}</el-button>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<el-row :gutter="20">
|
||||
<el-col
|
||||
:span="6"
|
||||
><div>{{ "Power:" + dataForm.power }}</div></el-col>
|
||||
<el-col
|
||||
:span="6"
|
||||
><div>{{ "SAP Material:" + dataForm.sapMaterial }}</div></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
<div>
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
:table-config="tableProps"
|
||||
:table-data="list"
|
||||
:is-loading="listLoading"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '@/lang'
|
||||
import BaseTable from '@/components/BaseTable'
|
||||
import {
|
||||
packagingDetail,
|
||||
packagingBoxList
|
||||
} from '@/api/orderManage/workOrder/workOrder'
|
||||
// import { timeFormatter } from '@/filters'
|
||||
import { getLodop } from '@/assets/libs/LodopFuncs.js'
|
||||
import { getInfo } from '@/api/packing-manage/packing-label.js'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'woSubstrateId',
|
||||
label: i18n.t('module.orderManage.packingTags.moduleId'),
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// prop: 'finishProduceTime',
|
||||
// label: i18n.t('module.orderManage.packingTags.UnloadingTime'),
|
||||
// align: 'center',
|
||||
// filter: timeFormatter
|
||||
// },
|
||||
// {
|
||||
// prop: 'name',
|
||||
// label: i18n.t('module.orderManage.packingTags.UnloadingEquipment'),
|
||||
// align: 'center'
|
||||
// },
|
||||
{
|
||||
prop: 'oneCode',
|
||||
label: i18n.t('module.orderManage.packingTags.oneDimensionalCode'),
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
components: { BaseTable },
|
||||
props: {
|
||||
packagingBoxId: {
|
||||
type: String,
|
||||
default: () => ({})
|
||||
},
|
||||
orderCode: {
|
||||
type: String,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
tableProps,
|
||||
list: [],
|
||||
total: 0,
|
||||
listLoading: false,
|
||||
dataForm: {},
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 500
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.listLoading = true
|
||||
packagingDetail(this.packagingBoxId).then(res => {
|
||||
this.dataForm = res.data
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.listQuery.packagingBoxId = this.packagingBoxId
|
||||
this.listLoading = true
|
||||
packagingBoxList(this.listQuery).then(response => {
|
||||
if (response.data.records) {
|
||||
this.list = response.data.records
|
||||
} else {
|
||||
this.list.splice(0, this.list.length)
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// btnClickPrint() {
|
||||
// const LODOP = getLodop()
|
||||
// const strHTML = document.getElementById('tablePrint').innerHTML
|
||||
// LODOP.ADD_PRINT_HTM(30, 5, '100%', '80%', strHTML) // 装载模板
|
||||
// LODOP.PREVIEW()
|
||||
// },
|
||||
btnClickPrint() {
|
||||
getInfo({ id: '1387070313172353025' }).then(res => {
|
||||
this.printPreview('预览', res.data.content)
|
||||
})
|
||||
},
|
||||
printPreview(name = '预览', modelCode) {
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT(name)
|
||||
const aaa = LODOP.ADD_PRINT_DATA('ProgramData', modelCode)
|
||||
console.log(aaa)
|
||||
const obj = {
|
||||
time: this.dataForm.packagingTime,
|
||||
orderCode: this.orderCode,
|
||||
power: this.dataForm.power,
|
||||
sapMaterial: this.dataForm.sapMaterial,
|
||||
BarCode: this.dataForm.boxNo
|
||||
}
|
||||
this.list.forEach((item, index) => {
|
||||
const str = 'modul' + (index + 1)
|
||||
obj[str] = item.woSubstrateId
|
||||
})
|
||||
console.log(obj)
|
||||
Object.keys(obj).forEach(key => {
|
||||
LODOP.SET_PRINT_STYLEA(key, 'CONTENT', obj[key])
|
||||
})
|
||||
LODOP.NewPageA()
|
||||
LODOP.PREVIEW()
|
||||
},
|
||||
print(name = '打印') {
|
||||
console.log(name, this.currentIndex)
|
||||
// 装载模板
|
||||
const modelCode = this.printModels[this.currentIndex].printModelContent
|
||||
console.log(modelCode)
|
||||
this.objs.forEach(obj => {
|
||||
const LODOP = getLodop() // 调用getLodop获取LODOP对象
|
||||
LODOP.PRINT_INIT(name)
|
||||
const aaa = LODOP.ADD_PRINT_DATA('ProgramData', modelCode)
|
||||
console.log(aaa)
|
||||
obj.partCode = obj.itemCode
|
||||
obj.productTypeName = obj.itemTypeName
|
||||
Object.keys(obj).forEach(key => {
|
||||
LODOP.SET_PRINT_STYLEA(key, 'CONTENT', obj[key])
|
||||
})
|
||||
// LODOP.ADD_PRINT_HTM(10, 10, 350, 600, `--------${index}----------`);
|
||||
LODOP.NewPageA()
|
||||
LODOP.PRINT()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-footer {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 50px;
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user