Commit 550a9ad9 authored by 沈翠玲's avatar 沈翠玲

LPN

parent 28af525c
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" size="mini" @click="handleprint"
type="primary"
size="mini"
@click="handleprint"
>打印</el-button >打印</el-button
> >
</el-form-item> </el-form-item>
...@@ -38,14 +35,15 @@ ...@@ -38,14 +35,15 @@
v-hasPermi="['pro:scheduleSetupRule:export']" v-hasPermi="['pro:scheduleSetupRule:export']"
>导出</el-button> >导出</el-button>
</el-col> --> </el-col> -->
<right-toolbar <!-- <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
></right-toolbar> ></right-toolbar> -->
</el-row> </el-row>
<el-table <el-table
v-loading="loading" v-loading="loading"
v-if="scheduleSetupRuleList.length > 0"
:data="scheduleSetupRuleList" :data="scheduleSetupRuleList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
...@@ -78,21 +76,13 @@ ...@@ -78,21 +76,13 @@
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
</el-table> </el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listlpnrecord } from '@/api/mes/lpn/lpnLabel' import { listlpnrecord } from '@/api/mes/lpn/lpnLabel'
import { listReport } from '@/api/mes/report/ureport' import { postBatchPrintPdf } from '@/utils/ruoyi'
export default { export default {
name: 'lpnLabel', name: 'lpnLabel',
...@@ -142,15 +132,31 @@ export default { ...@@ -142,15 +132,31 @@ export default {
} }
}, },
created() { created() {
this.getList() // this.getList()
}, },
methods: { methods: {
handleprint(){ handleprint() {
if (this.timer !== null) return if (this.timer !== null) return
this.timer = setTimeout(()=>{ this.timer = setTimeout(async () => {
console.log('打印', this.queryParams) this.timer = null
this.timer = null await this.getList()
},100) if (
!this.scheduleSetupRuleList ||
this.scheduleSetupRuleList.length === 0
)
return this.$modal.msgError('没有数据')
const valueList = this.scheduleSetupRuleList.map((v) => {
return {
packagePrint: {
lpnNo: v.lpnNo,
}
}
})
await postBatchPrintPdf('package-lpnV2', valueList).then(() => {
this.visible = false
this.getPackageList()
})
}, 100)
}, },
onItemSelected(obj) { onItemSelected(obj) {
if (obj != undefined && obj != null) { if (obj != undefined && obj != null) {
...@@ -160,9 +166,9 @@ export default { ...@@ -160,9 +166,9 @@ export default {
} }
}, },
/** 查询客户产品标签模板对照表列表 */ /** 查询客户产品标签模板对照表列表 */
getList() { async getList() {
this.loading = true this.loading = true
listlpnrecord(this.queryParams).then((response) => { await listlpnrecord(this.queryParams).then((response) => {
this.scheduleSetupRuleList = response.rows this.scheduleSetupRuleList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form
:model="queryParams" :model="queryParams"
ref="queryForm" ref="queryForm"
size="small" size="small"
:inline="true" :inline="true"
v-show="showSearch" v-show="showSearch"
@submit.native.prevent @submit.native.prevent
label-width="100px" label-width="100px"
> >
<el-form-item label="生产工单号" prop="workorderCode"> <el-form-item label="生产工单号" prop="workorderCode">
<el-input <el-input
v-model="queryParams.workorderCode" v-model="queryParams.workorderCode"
placeholder="请输入生产工单号" placeholder="请输入生产工单号"
clearable clearable
@keyup.enter.native="handleQuery" @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 </el-form-item>
label="销售编号" <el-form-item>
align="center" <el-button
width="160" type="primary"
prop="salesVoucher" icon="el-icon-search"
/> size="mini"
<el-table-column @click="handleQuery"
label="销售编号项次" >搜索</el-button
align="center" >
width="160" <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
prop="salesVoucherItem" >重置</el-button
/> > -->
<el-table-column label="LPN码" align="center" prop="lpnNo" /> </el-form-item>
<el-table-column label="on" align="center" prop="是否打印"> </el-form>
<template slot-scope="scope">
{{ scope.row.on ? '是' : '否' }} <el-row :gutter="10" class="mb8">
</template> <el-col :span="1.5">
</el-table-column> <el-button
<el-table-column label="创建人" align="center" prop="createBy" /> type="primary"
<el-table-column label="创建时间" align="center" prop="createTime" /> size="mini"
</el-table> :disabled="multiple"
@click="handleprint"
<pagination >打印</el-button
v-show="total > 0" >
:total="total" </el-col>
:page-sizes="[100, 500, 1000, 5000]" <right-toolbar
:page.sync="queryParams.pageNum" :showSearch.sync="showSearch"
:limit.sync="queryParams.pageSize" @queryTable="getList"
@pagination="getList" ></right-toolbar>
</el-row>
<el-table
v-loading="loading"
v-if="scheduleSetupRuleList.length > 0"
: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="是否打印">
</div> <template slot-scope="scope">
</template> {{ 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> <script>
import { listlpnrecord } from '@/api/mes/lpn/lpnLabel' import { listlpnrecord } from '@/api/mes/lpn/lpnLabel'
import { listReport } from '@/api/mes/report/ureport' import { postBatchPrintPdf } from '@/utils/ruoyi'
export default { export default {
name: 'lpnLabel', name: 'lpnLabel',
data() { data() {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
multiple: true, multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 客户产品标签模板对照表表格数据 // 客户产品标签模板对照表表格数据
scheduleSetupRuleList: [], scheduleSetupRuleList: [],
// 弹出层标题 // 弹出层标题
title: '', title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 100, pageSize: 100,
workorderCode: null, workorderCode: null,
}, },
customerOptions: [], customerOptions: [],
brandOptions: [], brandOptions: [],
templateOptions: [], templateOptions: [],
selectedRows: [], selectedRows: [],
timer: null, // 表单参数
// 表单参数 form: {},
form: {}, // 表单校验
// 表单校验 rules: {
rules: { templateId: [
templateId: [ {
{ required: true,
required: true, message: '请选择模板',
message: '请选择模板', trigger: ['blur', 'change'],
trigger: ['blur', 'change'], },
}, ],
], },
}, }
},
created() {
// this.getList()
},
methods: {
handleprint() {
const valueList = this.selectedRows.map((v) => {
return {
packagePrint: {
lpnNo: v.lpnNo,
},
}
})
postBatchPrintPdf('package-lpnV2', valueList).then(() => {
this.visible = false
this.getPackageList()
})
},
onItemSelected(obj) {
if (obj != undefined && obj != null) {
this.form.itemId = obj.itemId
this.form.itemCode = obj.itemCode
this.form.itemName = obj.itemName
}
},
/** 查询客户产品标签模板对照表列表 */
async getList() {
this.loading = true
await 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')
}, },
created() { /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
methods: { handleSelectProduct() {
handleprint(){ this.$refs.itemSelect.showFlag = true
if (this.timer !== null) return },
this.timer = setTimeout(()=>{ handleitemType() {
console.log('打印', this.queryParams) this.$refs.brSelect.showFlag = true
this.timer = null },
},100) onitemTypeed(row) {
}, if (Object.values(row).length > 0) {
onItemSelected(obj) { this.form.itemTypeId = row.itemTypeId
if (obj != undefined && obj != null) { this.form.sapTypeCode = row.sapTypeCode
this.form.itemId = obj.itemId this.form.itemTypeCode = row.itemTypeCode
this.form.itemCode = obj.itemCode this.form.itemTypeName = row.itemTypeName
this.form.itemName = obj.itemName }
},
/** 重置按钮操作 */
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()
})
}
} }
}, })
/** 查询客户产品标签模板对照表列表 */ },
getList() { /** 删除按钮操作 */
this.loading = true handleDelete(row) {
listlpnrecord(this.queryParams).then((response) => { const Ids = row.id || this.ids
this.scheduleSetupRuleList = response.rows this.$modal
this.total = response.total .confirm(
this.loading = false '是否确认删除客户产品标签模板对照表编号为"' + Ids + '"的数据项?'
)
.then(function () {
return delcustomerLabel(Ids)
}) })
}, .then(() => {
// 取消按钮 this.getList()
cancel() { this.$modal.msgSuccess('删除成功')
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()
})
}
}
}) })
}, .catch(() => {})
/** 删除按钮操作 */ },
handleDelete(row) { /** 导出按钮操作 */
const Ids = row.id || this.ids handleExport() {
this.$modal this.download(
.confirm( 'pro/scheduleSetupRule/export',
'是否确认删除客户产品标签模板对照表编号为"' + Ids + '"的数据项?' {
) ...this.queryParams,
.then(function () { },
return delcustomerLabel(Ids) `scheduleSetupRule_${new Date().getTime()}.xlsx`
}) )
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'pro/scheduleSetupRule/export',
{
...this.queryParams,
},
`scheduleSetupRule_${new Date().getTime()}.xlsx`
)
},
}, },
} },
</script> }
</script>
\ No newline at end of file
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