update - add补打条码记录

master
yinq 7 months ago
parent dc86698483
commit 25a488278a

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询补打条码记录列表
export function listSupplementBarCode(query) {
return request({
url: '/report/supplementBarCode/list',
method: 'get',
params: query
})
}
// 查询补打条码记录详细
export function getSupplementBarCode(objId) {
return request({
url: '/report/supplementBarCode/' + objId,
method: 'get'
})
}
// 新增补打条码记录
export function addSupplementBarCode(data) {
return request({
url: '/report/supplementBarCode',
method: 'post',
data: data
})
}
// 修改补打条码记录
export function updateSupplementBarCode(data) {
return request({
url: '/report/supplementBarCode',
method: 'put',
data: data
})
}
// 删除补打条码记录
export function delSupplementBarCode(objId) {
return request({
url: '/report/supplementBarCode/' + objId,
method: 'delete'
})
}

@ -0,0 +1,363 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="SAP计划编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入SAP计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="打印条码" prop="materialBarcode">
<el-input
v-model="queryParams.materialBarcode"
placeholder="请输入打印条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="打印时间">
<el-date-picker
v-model="daterangePrintTime"
style="width: 340px"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="打印名称" prop="printName">-->
<!-- <el-input-->
<!-- v-model="queryParams.printName"-->
<!-- placeholder="请输入打印名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="是否打印" prop="isPrint">-->
<!-- <el-input-->
<!-- v-model="queryParams.isPrint"-->
<!-- 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"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['report:supplementBarCode:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['report:supplementBarCode:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['report:supplementBarCode:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['report:supplementBarCode:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="supplementBarCodeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="objId" v-if="columns[0].visible"/>
<el-table-column label="SAP计划编号" align="center" prop="orderCode" v-if="columns[1].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[2].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="290" v-if="columns[3].visible"/>
<el-table-column label="打印条码" align="center" prop="materialBarcode" v-if="columns[4].visible"/>
<el-table-column label="打印时间" align="center" prop="printTime" width="180" v-if="columns[5].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.printTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="打印类型" align="center" prop="printBartype" v-if="columns[6].visible"/>
<el-table-column label="打印名称" align="center" prop="printName" v-if="columns[7].visible"/>
<el-table-column label="是否打印" align="center" prop="isPrint" v-if="columns[8].visible"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['report:supplementBarCode:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['report:supplementBarCode:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改补打条码记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="SAP计划编号" prop="orderCode">
<el-input v-model="form.orderCode" placeholder="请输入SAP计划编号" />
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" />
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" />
</el-form-item>
<el-form-item label="打印条码" prop="materialBarcode">
<el-input v-model="form.materialBarcode" placeholder="请输入打印条码" />
</el-form-item>
<el-form-item label="打印时间" prop="printTime">
<el-date-picker clearable
v-model="form.printTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择打印时间">
</el-date-picker>
</el-form-item>
<el-form-item label="打印名称" prop="printName">
<el-input v-model="form.printName" placeholder="请输入打印名称" />
</el-form-item>
<el-form-item label="是否打印" prop="isPrint">
<el-input v-model="form.isPrint" placeholder="请输入是否打印" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSupplementBarCode, getSupplementBarCode, delSupplementBarCode, addSupplementBarCode, updateSupplementBarCode } from "@/api/report/supplementBarCode";
export default {
name: "SupplementBarCode",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
supplementBarCodeList: [],
//
title: "",
//
open: false,
//
daterangePrintTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
orderCode: null,
materialCode: null,
materialName: null,
materialBarcode: null,
printTime: null,
printBartype: null,
printName: null,
isPrint: null
},
//
form: {},
//
rules: {
},
columns: [
{ key: 0, label: `主键`, visible: false },
{ key: 1, label: `SAP计划编号`, visible: true },
{ key: 2, label: `物料编码`, visible: true },
{ key: 3, label: `物料名称`, visible: true },
{ key: 4, label: `打印条码`, visible: true },
{ key: 5, label: `打印时间`, visible: true },
{ key: 6, label: `打印类型`, visible: true },
{ key: 7, label: `打印名称`, visible: true },
{ key: 8, label: `是否打印`, visible: true },
]
};
},
created() {
this.getList();
},
methods: {
/** 查询补打条码记录列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangePrintTime && '' != this.daterangePrintTime) {
this.queryParams.params["beginPrintTime"] = this.daterangePrintTime[0];
this.queryParams.params["endPrintTime"] = this.daterangePrintTime[1];
}
listSupplementBarCode(this.queryParams).then(response => {
this.supplementBarCodeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
objId: null,
orderCode: null,
materialCode: null,
materialName: null,
materialBarcode: null,
printTime: null,
printBartype: null,
printName: null,
isPrint: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangePrintTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.objId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加补打条码记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const objId = row.objId || this.ids
getSupplementBarCode(objId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改补打条码记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.objId != null) {
updateSupplementBarCode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSupplementBarCode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const objIds = row.objId || this.ids;
this.$modal.confirm('是否确认删除补打条码记录编号为"' + objIds + '"的数据项?').then(function() {
return delSupplementBarCode(objIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('report/supplementBarCode/export', {
...this.queryParams
}, `supplementBarCode_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save