Commit 691bd0fc authored by 沈翠玲's avatar 沈翠玲

修改代码

parent b7d5e0d3
import request from '@/utils/request'
// 查询列表
export function listlpnrecord(query) {
return request({
url: '/pro/serial/lpn/record/list',
method: 'get',
params: query
})
}
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
@submit.native.prevent
label-width="100px"
>
<el-form-item label="LPN扫码/输入" prop="lpnNo">
<el-input
v-model="queryParams.lpnNo"
placeholder="LPN扫码/输入回车立马打印"
clearable
@keyup.enter.native="handleprint"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="mini"
@click="handleprint"
>打印</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pro:scheduleSetupRule:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="scheduleSetupRuleList"
@selection-change="handleSelectionChange"
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column
label="工单号"
align="center"
width="120"
prop="workorderCode"
/>
<el-table-column
label="销售编号"
align="center"
width="160"
prop="salesVoucher"
/>
<el-table-column
label="销售编号项次"
align="center"
width="160"
prop="salesVoucherItem"
/>
<el-table-column label="LPN码" align="center" prop="lpnNo" />
<el-table-column label="on" align="center" prop="是否打印">
<template slot-scope="scope">
{{ scope.row.on ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listlpnrecord } from '@/api/mes/lpn/lpnLabel'
import { listReport } from '@/api/mes/report/ureport'
export default {
name: 'lpnLabel',
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 客户产品标签模板对照表表格数据
scheduleSetupRuleList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
lpnNo: null,
},
customerOptions: [],
brandOptions: [],
templateOptions: [],
selectedRows: [],
timer: null,
// 表单参数
form: {},
// 表单校验
rules: {
templateId: [
{
required: true,
message: '请选择模板',
trigger: ['blur', 'change'],
},
],
},
}
},
created() {
this.getList()
},
methods: {
handleprint(){
if (this.timer !== null) return
this.timer = setTimeout(()=>{
console.log('打印', this.queryParams)
this.timer = null
},100)
},
onItemSelected(obj) {
if (obj != undefined && obj != null) {
this.form.itemId = obj.itemId
this.form.itemCode = obj.itemCode
this.form.itemName = obj.itemName
}
},
/** 查询客户产品标签模板对照表列表 */
getList() {
this.loading = true
listlpnrecord(this.queryParams).then((response) => {
this.scheduleSetupRuleList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
itemCode: null,
customerName: null,
brandName: null,
brandCode: null,
brandId: null,
itemId: null,
itemName: null,
itemTypeCode: null,
itemTypeId: null,
itemTypeName: null,
sapItemCode: null,
templateName: null,
templateType: null,
templateCode: null,
templateId: null,
createBy: null,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
handleSelectProduct() {
this.$refs.itemSelect.showFlag = true
},
handleitemType() {
this.$refs.brSelect.showFlag = true
},
onitemTypeed(row) {
if (Object.values(row).length > 0) {
this.form.itemTypeId = row.itemTypeId
this.form.sapTypeCode = row.sapTypeCode
this.form.itemTypeCode = row.itemTypeCode
this.form.itemTypeName = row.itemTypeName
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.selectedRows = selection
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加客户产品标签模板对照表'
},
/** 修改按钮操作 */
handleUpdate(row) {
if (!row || !row.id) row = this.selectedRows[0]
this.reset()
this.form = row
this.open = true
this.title = '修改客户产品标签模板对照表'
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.customerCode) {
this.form.customerName = this.customerOptions.find(
(v) => this.form.customerCode === v.KUNNR
).NAME
}
if (this.form.brandCode) {
this.form.brandName = this.brandOptions.find(
(v) => this.form.brandCode === v.brandCode
).brandName
}
if (this.form.templateId) {
const template = this.templateOptions.find(
(v) => this.form.templateId === v.id
)
this.form.templateName = template.name
this.form.templateType = template.reportType
this.form.templateCode = template.id + ''
}
if (this.form.id != null) {
updateCustomerLabel(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addCustomerLabel(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const Ids = row.id || this.ids
this.$modal
.confirm(
'是否确认删除客户产品标签模板对照表编号为"' + Ids + '"的数据项?'
)
.then(function () {
return delcustomerLabel(Ids)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'pro/scheduleSetupRule/export',
{
...this.queryParams,
},
`scheduleSetupRule_${new Date().getTime()}.xlsx`
)
},
},
}
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
@submit.native.prevent
label-width="100px"
>
<el-form-item label="生产工单号" prop="workorderCode">
<el-input
v-model="queryParams.workorderCode"
placeholder="请输入生产工单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
size="mini"
:disabled="multiple"
@click="handleprint"
>打印</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="scheduleSetupRuleList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="工单号"
align="center"
width="120"
prop="workorderCode"
/>
<el-table-column
label="销售编号"
align="center"
width="160"
prop="salesVoucher"
/>
<el-table-column
label="销售编号项次"
align="center"
width="160"
prop="salesVoucherItem"
/>
<el-table-column label="LPN码" align="center" prop="lpnNo" />
<el-table-column label="on" align="center" prop="是否打印">
<template slot-scope="scope">
{{ scope.row.on ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page-sizes="[100, 500, 1000, 5000]"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listlpnrecord } from '@/api/mes/lpn/lpnLabel'
import { listReport } from '@/api/mes/report/ureport'
export default {
name: 'lpnLabel',
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 客户产品标签模板对照表表格数据
scheduleSetupRuleList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 100,
workorderCode: null,
},
customerOptions: [],
brandOptions: [],
templateOptions: [],
selectedRows: [],
timer: null,
// 表单参数
form: {},
// 表单校验
rules: {
templateId: [
{
required: true,
message: '请选择模板',
trigger: ['blur', 'change'],
},
],
},
}
},
created() {
this.getList()
},
methods: {
handleprint(){
if (this.timer !== null) return
this.timer = setTimeout(()=>{
console.log('打印', this.queryParams)
this.timer = null
},100)
},
onItemSelected(obj) {
if (obj != undefined && obj != null) {
this.form.itemId = obj.itemId
this.form.itemCode = obj.itemCode
this.form.itemName = obj.itemName
}
},
/** 查询客户产品标签模板对照表列表 */
getList() {
this.loading = true
listlpnrecord(this.queryParams).then((response) => {
this.scheduleSetupRuleList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
itemCode: null,
customerName: null,
brandName: null,
brandCode: null,
brandId: null,
itemId: null,
itemName: null,
itemTypeCode: null,
itemTypeId: null,
itemTypeName: null,
sapItemCode: null,
templateName: null,
templateType: null,
templateCode: null,
templateId: null,
createBy: null,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
handleSelectProduct() {
this.$refs.itemSelect.showFlag = true
},
handleitemType() {
this.$refs.brSelect.showFlag = true
},
onitemTypeed(row) {
if (Object.values(row).length > 0) {
this.form.itemTypeId = row.itemTypeId
this.form.sapTypeCode = row.sapTypeCode
this.form.itemTypeCode = row.itemTypeCode
this.form.itemTypeName = row.itemTypeName
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.selectedRows = selection
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加客户产品标签模板对照表'
},
/** 修改按钮操作 */
handleUpdate(row) {
if (!row || !row.id) row = this.selectedRows[0]
this.reset()
this.form = row
this.open = true
this.title = '修改客户产品标签模板对照表'
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.customerCode) {
this.form.customerName = this.customerOptions.find(
(v) => this.form.customerCode === v.KUNNR
).NAME
}
if (this.form.brandCode) {
this.form.brandName = this.brandOptions.find(
(v) => this.form.brandCode === v.brandCode
).brandName
}
if (this.form.templateId) {
const template = this.templateOptions.find(
(v) => this.form.templateId === v.id
)
this.form.templateName = template.name
this.form.templateType = template.reportType
this.form.templateCode = template.id + ''
}
if (this.form.id != null) {
updateCustomerLabel(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addCustomerLabel(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const Ids = row.id || this.ids
this.$modal
.confirm(
'是否确认删除客户产品标签模板对照表编号为"' + Ids + '"的数据项?'
)
.then(function () {
return delcustomerLabel(Ids)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'pro/scheduleSetupRule/export',
{
...this.queryParams,
},
`scheduleSetupRule_${new Date().getTime()}.xlsx`
)
},
},
}
</script>
\ No newline at end of file
......@@ -48,6 +48,7 @@
v-hasPermi="['pro:scheduleSetupRule:remove']"
>删除</el-button>
</el-col>
-->
<el-col :span="1.5">
<el-button
type="warning"
......@@ -55,16 +56,18 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pro:scheduleSetupRule:export']"
>导出</el-button>
</el-col> -->
:disabled="single"
v-hasPermi="['pro:dta:export']"
>LPN导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="scheduleSetupRuleList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单编号" align="center" prop="workorderCode" />
<el-table-column label="销售单号" align="center" prop="saleCode" />
<el-table-column label="销售单号" align="center" prop="salesVoucher" />
<el-table-column label="销售单号项次" align="center" prop="salesVoucherItem" />
<el-table-column label="物料名称" align="center" prop="itemName" />
<el-table-column label="开始时间" align="center" prop="startTime" />
<el-table-column label="排版方式" align="center" prop="dtaType"
......@@ -229,6 +232,7 @@ export default {
return {
// 遮罩层
loading: true,
selectedRows: [],
// 选中数组
ids: [],
//dta列表
......@@ -336,6 +340,7 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
this.selectedRows = selection
this.ids = selection.map(item => item.ruleId)
this.single = selection.length!==1
this.multiple = !selection.length
......@@ -397,9 +402,11 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('pro/scheduleSetupRule/export', {
...this.queryParams
}, `scheduleSetupRule_${new Date().getTime()}.xlsx`)
const row = this.selectedRows[0]
this.download('pro/serial/lpn/record/export', {
salesVoucher: row.salesVoucher,
salesVoucherItem: row.salesVoucherItem,
}, `dta_${new Date().getTime()}.xlsx`)
}
}
};
......
......@@ -147,9 +147,9 @@ export default {
this.handleQuery();
},
async handleFous(row) {
if (row.taskList&&row.taskList.length) {
return
}
// if (row.taskList&&row.taskList.length) {
// return
// }
const response = await gettaskWorkunitList({workstationId: row.workstationId})
this.$set(row,'taskList',response.rows)
console.log(row)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment