计件工资报表修改

yangwl
Yangwl 4 months ago
parent a3ac4f10c1
commit 1765a6a2c2

@ -16,7 +16,6 @@ export function getUnitPrice(picId) {
method: 'get'
});
}
// 新增unitPrice
export function addUnitPrice(data) {
return request({

@ -8,12 +8,7 @@ export function listUnitPriceReport(query) {
params: query
});
}
// export function getReport(id) {
// return request({
// url: '/mes/unitPriceReport/' + id,
// method: 'get'
// });
// }
// 查询【计件工资】详细
export function getReport(id) {
return request({
@ -29,3 +24,20 @@ export function updateUnitPriceReport(data) {
data: data
});
}
// 新增
// 计件工资统计
export function addUnitPriceReport(data) {
return request({
url: '/mes/unitPriceReport',
method: 'post',
data: data
});
}
// 查询生产工单列表--顶级母
export function listWorkorderLevel0(query) {
return request({
url: '/plan/pro/workorder/listLevel0',
method: 'get',
params: query
});
}

@ -17,6 +17,14 @@ export function getUser(userId) {
method: 'get'
})
}
// 查询用户详细-通过工号
export function getUserByUserName(data) {
return request({
url: '/system/user/getInfoByUserName/',
method: 'post',
data: data
})
}
// 新增用户
export function addUser(data) {

@ -0,0 +1,5 @@
<svg t="1720683721767" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1481" width="200" height="200"><path d="M819.2 364.8h-44.8V128c0-17.066667-14.933333-32-32-32H281.6c-17.066667 0-32 14.933333-32 32v236.8H204.8c-59.733333 0-108.8 49.066667-108.8 108.8v192c0 59.733333 49.066667 108.8 108.8 108.8h44.8V896c0 17.066667 14.933333 32 32 32h460.8c17.066667 0 32-14.933333 32-32v-121.6h44.8c59.733333 0 108.8-49.066667 108.8-108.8v-192c0-59.733333-49.066667-108.8-108.8-108.8zM313.6 160h396.8v204.8H313.6V160z m396.8 704H313.6V620.8h396.8v243.2z m153.6-198.4c0 25.6-19.2 44.8-44.8 44.8h-44.8v-121.6c0-17.066667-14.933333-32-32-32H281.6c-17.066667 0-32 14.933333-32 32v121.6H204.8c-25.6 0-44.8-19.2-44.8-44.8v-192c0-25.6 19.2-44.8 44.8-44.8h614.4c25.6 0 44.8 19.2 44.8 44.8v192z" fill="#1296db" p-id="1482"></path></svg>

After

Width:  |  Height:  |  Size: 866 B

@ -42,10 +42,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="员工姓名" prop="nickName">
<el-form-item label="员工姓名/工号" prop="nickName" label-width="100px">
<el-input
v-model="queryParams.equipmentName"
placeholder="请输入员工姓名"
v-model="queryParams.nickName"
placeholder="请输入员工姓名/工号"
clearable
@keyup.enter.native="handleQuery"
/>
@ -69,16 +69,15 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['unitPriceReport:report:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="openSelectOrder"
v-hasPermi="['device:item:add']"
>补录
</el-button>
<el-button
type="success"
plain
@ -156,7 +155,7 @@
@pagination="getList"
/>
<!-- 添加或修改unitPrice对话框 -->
<!-- 修改unitPrice对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" label-width="100px">
@ -281,16 +280,243 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 新增unitPrice对话框 -->
<el-dialog :title="addtitle" :visible.sync="addopen" width="680px" append-to-body>
<el-form ref="addform" :model="addform" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="工单号" prop="workorderCode" >
<el-input v-model="addform.workorderCode" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="SAP订单号" prop="workorderCodeSap" >
<el-input v-model="addform.workorderCodeSap" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工单生产日期" prop="workOrderProductDate" >
<el-date-picker
v-model="addform.workOrderProductDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择生产日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料码" prop="productCode" >
<el-input v-model="addform.productCode" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="产品描述" prop="productName" >
<el-input v-model="addform.productName" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="工序" prop="childprocessName" >
<el-select v-model="addform.childprocessName" single placeholder="请选择工序">
<el-option
v-for="item in childprocessNameOptions"
:key="item.picId"
:label="item.childprocessName"
:value="item.childprocessCode"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产线编码" prop="workorderName" >
<el-input v-model="addform.workorderName" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="addform.post" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工号" prop="userName" >
<el-input v-model="addform.userName" @keyup.enter.native="handleQueryUser">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="员工姓名" prop="nickName" >
<el-input v-model="addform.nickName" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产量" prop="attr1" >
<el-input v-model="addform.attr1" >
<template #suffix>PC</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工时" prop="attr2" >
<el-input v-model="addform.attr2" >
<template #suffix>小时</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="扣款" prop="kk" >
<el-input v-model="addform.kk" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保底" prop="bd" >
<el-input v-model="addform.bd" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="转岗" prop="zg" >
<el-input v-model="addform.zg" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="返工费用" prop="fg" >
<el-input v-model="addform.fg" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="试产" prop="sc" >
<el-input v-model="addform.sc" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="试机" prop="sj" >
<el-input v-model="addform.sj" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="特殊费用" prop="tsfy" >
<el-input v-model="addform.tsfy" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="夜班补贴" prop="ybbt" >
<el-input v-model="addform.ybbt" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="协产补贴" prop="xcbt" >
<el-input v-model="addform.xcbt" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-col :span="24">
<el-form-item label="备注">
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
<el-select
v-model="addform.remark"
placeholder="备注"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.unit_price"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addsubmitForm"> </el-button>
<el-button @click="addcancel"> </el-button>
</div>
</el-dialog>
<select-order ref="orderselect" :datasourceId="queryParams.datasourceId" @ok="handleQuery" @showAddDialog="showAddDialog" />
</div>
</template>
<script>
// import { ElEditable } from 'element-plus';
import { getToken } from "@/utils/auth";
import { listUnitPriceReport,getReport,updateUnitPriceReport } from "@/api/mes/unitPriceReport";
import { listUnitPriceReport,getReport,updateUnitPriceReport,addUnitPriceReport } from "@/api/mes/unitPriceReport";
import { listUnitPrice } from "@/api/mes/unitPrice";
import { getUserByUserName } from "@/api/system/user";
import selectOrder from "./selectOrder";
export default {
name: "UnitPrice",
name: "UnitPriceReport",
dicts: ['unit_price'],
components: { selectOrder }, //
data() {
return {
//
@ -307,10 +533,15 @@ export default {
total: 0,
// unitPrice
unitPriceList: [],
//
postOptions: [],
childprocessNameOptions: [],
//
title: "",
addtitle: "",
//
open: false,
addopen: false,
value: '',
//
dateRange: [],
@ -319,6 +550,7 @@ export default {
pageNum: 1,
pageSize: 10,
factoryId: null,
datasourceId: undefined,
workorderCodeSap: null,
productCode: null,
productName: null,
@ -333,11 +565,14 @@ export default {
attr4: null,
},
productQueryParams:{
pageNum: 1,
pageSize: 10,
productCode: null,
productName: null,
},
//
form: {},
addform:{},
//
productCodeList: [],
state: '',
@ -346,58 +581,22 @@ export default {
tableData: [],
MesUnitPriceInfo: [],
//
// rules: {
// attr2: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// attr1: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// bd: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// zg: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// fg: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// sc: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// sj: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// tsfy: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// ybbt: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// }
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
],
childprocessName: [
{ required: true, message: "工序不能为空", trigger: "blur" }
],
}
};
//
// const validateNumberOrDecimal = (rule, value, callback) => {
// const regex = /^(\d+(\.\d{1,2})?)?$/;
// if (!regex.test(value)) {
// callback(new Error(''));
// } else {
// callback();
// }
// };
},
created() {
this.getList();
// this.fetchProcessOptions();
this.getList();
},
methods: {
handleEdit(index, row) {
@ -418,6 +617,14 @@ export default {
this.open = false;
this.reset();
},
addcancel(){
this.addopen = false;
this.addreset();
},
addreset(){
this.addform = {};
this.resetForm("addform");
},
//
reset() {
this.form = {
@ -448,6 +655,15 @@ export default {
this.queryParams.pageNum = 1;
this.getList();
},
handleQueryUser(){
getUserByUserName(this.addform).then(response => {
this.postOptions = response.posts;
this.$set(this.addform, "post", response.postIds);
this.addform.nickName=response.data.nickName;
});
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
@ -460,23 +676,31 @@ export default {
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加计件薪酬信息";
openSelectOrder() {
this.$refs.orderselect.show();
},
/** 修改按钮操作 */
// handleUpdate(row) {
// console.log(row)
// this.reset();
// const picId = row.id || this.ids
// getReport(picId).then(response => {
// this.form = response.data.MesUnitpriceReport;
// this.open = true;
// this.MesUnitPriceInfo=response.data.MesUnitPriceInfo;
// });
// },
/** 新增按钮操作 */
showAddDialog(currentRow) {
this.reset();
//
this.productQueryParams.productCode=currentRow.productCode.slice(7, 18);
this.productQueryParams.lineCode=currentRow.sapCode;
listUnitPrice(this.productQueryParams).then(response => {
this.childprocessNameOptions = response.rows;
// this.$set(this.addform, "post", response.rows);
});
this.addopen = true;
this.addform.workorderCode=currentRow.workorderCode;
this.addform.workorderCodeSap=currentRow.workorderCodeSap;
this.addform.workOrderProductDate=currentRow.productDate;
this.addform.productCode=currentRow.productCode;
this.addform.productName=currentRow.productName;
this.addform.workorderName=currentRow.sapCode;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -513,6 +737,23 @@ export default {
}
});
},
/** 新增提交按钮 */
addsubmitForm() {
this.$refs["addform"].validate(valid => {
if (valid) {
console.log(this.addform)
const post=this.addform.post[0]
this.addform.post=null;
this.addform.post=post;
addUnitPriceReport(this.addform).then(response => {
this.$modal.msgSuccess("新增成功");
this.addopen = false;
this.addform = {};
this.getList();
})
}
})
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/unitPriceReport/export', {

@ -0,0 +1,158 @@
<template>
<!-- 授权用户 -->
<el-dialog title="选择订单" :visible.sync="visible" width="1200px" top="5vh" append-to-body>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-form-item label="生产日期" prop="productDate">
<el-date-picker
v-model="queryParams.productDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="产线编码" prop="workorderName">
<el-select clearable v-model="queryParams.workorderName">
<el-option
v-for="item in prodLineList"
:key="item.lineCode"
:label="item.lineName"
:value="item.lineCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料编码" prop="productCode">
<el-input
v-model="queryParams.productCode"
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>
<!-- <el-table-->
<!-- ref="singleTable"-->
<!-- :data="userList"-->
<!-- highlight-current-row-->
<!-- @selection-change="handleSelectionChange">-->
<el-table
ref="table"
:data="userList"
highlight-current-row
@current-change="handleCurrentChange"
height="260px">
<el-table-column label="工单号" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="SAP订单号" prop="workorderCodeSap" :show-overflow-tooltip="true" />
<el-table-column label="产品编码" width="200" prop="productCode" :show-overflow-tooltip="true" />
<el-table-column label="产品名称" width="200" prop="productName" :show-overflow-tooltip="true" />
<el-table-column label="生产日期" prop="productDate" :show-overflow-tooltip="true" />
<el-table-column label="产线" prop="sapName" :show-overflow-tooltip="true" />
<el-table-column label="产线编码" prop="sapCode" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSelectUser"> </el-button>
<el-button @click="visible = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
listWorkorderLevel0,
getProdLineList
} from '@/api/plan/workorder'
export default {
dicts: ['sys_normal_disable'],
props: {
//
datasourceId: {
type: [Number, String]
}
},
data() {
return {
//
visible: false,
//
orderId: null,
//
total: 0,
//
userList: [],
prodLineList:[],
currentRow: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
datasourceId: undefined,
userName: undefined,
phonenumber: undefined,
}
};
},
created() {
getProdLineList().then(response => {
this.prodLineList = response
})
},
methods: {
//
show() {
this.queryParams.datasourceId = this.datasourceId;
this.getList();
this.visible = true;
},
clickRow(row) {
this.$refs.table.toggleRowSelection(row);
},
//
handleCurrentChange(val) {
this.currentRow = val;
},
//
getList() {
this.queryParams.parentOrder= '0';
listWorkorderLevel0(this.queryParams).then(res => {
console.log(res)
this.userList = res.rows;
this.total = res.total;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 选择授权用户操作 */
handleSelectUser() {
this.visible = false;
this.$emit('showAddDialog',this.currentRow); //
}
}
};
</script>
Loading…
Cancel
Save