add 包装报工-检测线报工

This commit is contained in:
lb 2023-08-25 10:51:16 +08:00
parent 521563bd00
commit 807766f83f
6 changed files with 342 additions and 6 deletions

View File

@ -38,8 +38,8 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv

View File

@ -168,6 +168,7 @@ export default {
return this.dataList.length;
},
},
inject: ['urls'],
watch: {
"dataForm.goodqty"(val) {
const qty = +val + +this.dataForm.badqty;
@ -184,7 +185,8 @@ export default {
async init() {
this.visible = true;
this.loading = true;
const { data: res } = await this.$http.post("/pms/workReport/pressReportPre", {
// const { data: res } = await this.$http.post("/pms/workReport/pressReportPre", {
const { data: res } = await this.$http.post(this.urls.reportPre, {
datas: [],
ids: this.ids,
});
@ -226,14 +228,14 @@ export default {
async handleConfirm() {
this.loading = true;
const { data: res } = await this.$http.post("/pms/workReport/pressReport", {
const { data: res } = await this.$http.post(this.urls.report, {
datas: this.dataList,
ids: this.ids,
});
this.loading = false;
if (res.code === 0) {
this.$message.success("提交成功");
this.$emit('refresh-list')
this.$emit("refresh-list");
this.close();
}
},

View File

@ -93,7 +93,7 @@ export default function () {
],
default: { value: "0" },
bind: {
placeholder: "请输入班次",
placeholder: "请输入报工状态",
},
},
{
@ -239,6 +239,8 @@ export default function () {
base: "/pms/carOrderReport",
page: "/pms/carOrderReport/pageView",
pageIsPostApi: true,
reportPre: '/pms/workReport/pressReportPre',
report: '/pms/workReport/pressReport',
},
};
}

View File

@ -0,0 +1,61 @@
<!--
filename: index.vue
author: liubin
date: 2023-08-25 10:27:58
description: 包装报工
-->
<template>
<div class="list-view-with-head" ref="pointer-loading-ref">
<el-row :gutter="20">
<el-col :span="6">
<el-input v-model="hu" placeholder="扫描HU号" @keydown.enter.native="handleReport"></el-input>
</el-col>
<el-col :span="6">
<el-button @click="handleReport" type="primary" plain>报工</el-button>
</el-col>
</el-row>
</div>
</template>
<script>
// import BaseSearchForm from "@/components/BaseSearchForm.vue";
export default {
name: "PackReport",
// components: { BaseSearchForm },
data() {
return {
hu: "40032179#300000624000000016",
};
},
methods: {
handleReport() {
this.$http({
url: "/pms/workReport/packReport",
method: "post",
data: this.hu,
headers: {
"Content-Type": "application/json",
},
}).then(({ data: res }) => {
if (res.code == 0) {
this.$message.success("报工成功");
} else {
this.$message.error(res.msg);
}
});
},
},
};
</script>
<style scoped>
.list-view-with-head {
background: white;
/* height: 100%; */
min-height: inherit;
border-radius: 6px;
padding: 16px;
box-shadow: 0 0 1.125px 0.125px rgba(0, 0, 0, 0.125);
}
</style>

View File

@ -0,0 +1,220 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
import QuillRichInput from "@/components/noTemplateComponents/richInput";
import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters";
export default function () {
const tableProps = [
// 多选框
{ type: "selection", width: 60, align: "center" },
{ width: 128, prop: "createTime", label: "记录时间", filter: timeFilter },
{ width: 90, prop: "updaterName", label: "更改人" },
{ width: 90, prop: "code", label: "托盘号" },
{ width: 128, prop: "typeDictValue", label: "托盘类型", filter: dictFilter("pallet_type") },
{ width: 128, prop: "orderCode", label: "订单号" },
{ width: 128, prop: "orderCate", label: "订单子号" },
{ width: 128, prop: "description", label: "HU" },
{ width: 128, prop: "shapeCode", label: "砖型" },
{ width: 128, prop: "brand", label: "配方" },
{ width: 128, prop: "packTechCode", label: "包装代码" },
{ width: 128, prop: "saleNo", label: "销售订单" },
{ width: 128, prop: "saleOrderItem", label: "销售订单Item" },
{ width: 128, prop: "realQty", label: "数量" },
{
width: 128,
prop: "insTeam",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
width: 128,
prop: "insReport",
label: "报工",
filter: (val) => (val != null ? ["未报工", "已报工"][val] : "-"),
},
{ width: 128, prop: "insRtime", label: "报工时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", enable: (row) => row.insReport == 0 },
// {
// name: "delete",
// icon: "delete",
// label: "删除",
// emitFull: true,
// permission: "pms:carOrderReport:delete",
// },
],
},
];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [
{
prop: "orderCode",
label: "订单号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入订单号",
},
},
{
prop: "code",
label: "托盘号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入托盘号",
},
},
{
prop: "insTeam",
label: "班次",
select: [
{ label: "早班", value: "0" },
{ label: "中班", value: "1" },
{ label: "晚班", value: "2" },
],
default: { value: "" },
bind: {
placeholder: "请输入班次",
},
},
{
prop: "insReport",
label: "报工",
select: [
{ label: "未报工", value: "0" },
{ label: "已报工", value: "1" },
],
default: { value: "0" },
bind: {
placeholder: "请输入报工状态",
},
},
{
timerange: true,
prop: "timerange",
label: "时间段",
default: { value: [today - 3600 * 24 * 6 * 1000, today + 3600 * 24 * 1000] },
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "报工",
permission: "pms:palletOrderReport:report",
},
bind: {
plain: true,
},
},
];
const dialogJustFormConfigs = {
clickModalToClose: false,
form: {
rows: [
[
{
forceDisabled: true,
label: "托盘号",
prop: "code",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入托盘号" },
},
],
[
{
forceDisabled: true,
label: "订单号",
prop: "orderCode",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单号" },
},
],
[
{
forceDisabled: true,
label: "订单子号",
prop: "orderCate",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单子号" },
},
],
[
{
input: true,
label: "数量",
prop: "realQty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入合格数量" },
},
],
],
operations: [
{
name: "add",
label: "保存",
type: "primary",
permission: "pms:palletOrderReport:save",
showOnEdit: false,
},
{
name: "update",
label: "更新",
type: "primary",
permission: "pms:palletOrderReport:update",
showOnEdit: true,
},
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/palletOrderReport",
page: "/pms/palletOrderReport/pageView",
pageIsPostApi: true,
reportPre: '/pms/workReport/insReportPre',
report: '/pms/workReport/insReport',
},
};
}

View File

@ -0,0 +1,51 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:listQueryExtra="['carCode', 'orderCode', 'team', { report: 0, startTime: now[0], endTime: now[1] }]" />
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
import moment from "moment";
export default {
name: "CarView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
computed: {
now() {
const curr = this.headFormConfigs.fields.find((item) => item.prop == "timerange").default.value;
return [
moment(curr[0]).format("YYYY-MM-DDTHH:mm:ss"),
moment(curr[1]).format("YYYY-MM-DDTHH:mm:ss"),
]
// const start = new Date(curr[0]);
// const end = new Date(curr[1]);
// return [
// start.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
// end.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
// ]
},
},
methods: {},
};
</script>
<style scoped></style>