diff --git a/src/api/mes/reportWorks.js b/src/api/mes/reportWorks.js new file mode 100644 index 0000000..adf968b --- /dev/null +++ b/src/api/mes/reportWorks.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function listReportWorks(query) { + return request({ + url: '/mes/reportWorks/lists', + method: 'get', + params: query + }); +} diff --git a/src/api/mes/unitPriceReport.js b/src/api/mes/unitPriceReport.js new file mode 100644 index 0000000..b465c2f --- /dev/null +++ b/src/api/mes/unitPriceReport.js @@ -0,0 +1,24 @@ +import request from '@/utils/request' + +// 查询unitPrice列表 +export function listUnitPriceReport(query) { + return request({ + url: '/mes/unitPriceReport/list', + method: 'get', + params: query + }); +} +export function getReport(id) { + return request({ + url: '/mes/unitPriceReport/' + id, + method: 'get' + }); +} +// 修改计件工资统计 +export function updateUnitPriceReport(data) { + return request({ + url: '/mes/unitPriceReport', + method: 'put', + data: data + }); +} diff --git a/src/api/wms/product.js b/src/api/wms/product.js index 968edb2..9a8a974 100644 --- a/src/api/wms/product.js +++ b/src/api/wms/product.js @@ -23,7 +23,13 @@ export function getProduct(productId) { method: 'get' }); } - +// 查询物料信息详细 +export function getProductByCode(productCode) { + return request({ + url: '/wms/product/code/' + productCode, + method: 'get' + }); +} // 新增物料信息 export function addProduct(data) { return request({ diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue index 92c0d0f..ec5cc17 100644 --- a/src/views/mes/reportWork/index.vue +++ b/src/views/mes/reportWork/index.vue @@ -1,547 +1,612 @@ - - - - - - - - - + + + + + + + + + + diff --git a/src/views/mes/reportWorks/index.vue b/src/views/mes/reportWorks/index.vue new file mode 100644 index 0000000..497b06b --- /dev/null +++ b/src/views/mes/reportWorks/index.vue @@ -0,0 +1,395 @@ + + + diff --git a/src/views/mes/unitprice/index.vue b/src/views/mes/unitprice/index.vue index 00c7e02..b2076df 100644 --- a/src/views/mes/unitprice/index.vue +++ b/src/views/mes/unitprice/index.vue @@ -44,27 +44,27 @@ - - 新增 - - - 修改 - + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + @@ -165,24 +166,18 @@ - - - - - - npn + + + + + + + + + + + + @@ -191,46 +186,69 @@ + + + + + + + + + + + + + + + + + + + + + + + - 操作步骤 - 添加 - - - - + + + + + + + + + + + + + + + - - - + + + + - - - - - - - + + + + + + + + + + + + @@ -255,9 +273,9 @@
将文件拖到此处,或点击上传
-
- 是否更新已经存在的数据 -
+ + + 仅允许导入xls、xlsx格式文件。 下载模板
@@ -274,7 +292,7 @@ // import { ElEditable } from 'element-plus'; import { getToken } from "@/utils/auth"; import { listUnitPrice, getUnitPrice, delUnitPrice, addUnitPrice, updateUnitPrice } from "@/api/mes/unitPrice"; -import { listProduct} from "@/api/wms/product"; +import { getProductByCode} from "@/api/wms/product"; import { listChildprocessall} from "@/api/mes/childprocess"; export default { name: "UnitPrice", @@ -372,6 +390,9 @@ export default { ], lineName: [ { required: true, message: "产线不能为空", trigger: "blur" }, + ], + attr1: [ + { required: true, message: "单价不能为空", trigger: "blur" }, ], }, productCodeList: [], @@ -418,13 +439,12 @@ export default { console.log('Edited row:', row); row._editablechildProcessName = false; // Set _editable to false after editing }, - handleInput(row, index) { - // 当输入发生变化时触发的方法 - // 使用正则表达式验证输入是否为数字或小数 - const numericRegex = /^\d+(\.\d*)?$/; - if (!numericRegex.test(row.unitPrice)) { - // 如果输入不是数字或小数,则清除非数字字符 - this.$set(this.tableData, index, { ...row, unitPrice: row.unitPrice.replace(/[^\d.]/g, '') }); + handleInput(value) { + // 通过正则表达式检查输入是否为数字或小数 + const regex = /^[0-9]*\.?[0-9]*$/; + if (!regex.test(value)) { + // 如果输入不是数字或小数,将其修正为合法的数字或小数 + this.form.attr1 = value.replace(/[^0-9.]/g, ''); } }, handleEditUnitPrice(row, index) { @@ -499,7 +519,7 @@ export default { getUnitPrice(picId).then(response => { this.form = response.data; this.open = true; - this.title = "修改unitPrice"; + this.title = "修改产品单价"; }); }, /** 提交按钮 */ @@ -507,19 +527,20 @@ export default { this.$refs["form"].validate(valid => { if (valid) { console.log(this.form,this.tableData) - // if (this.form.picId != null) { - // updateUnitPrice(this.form).then(response => { - // this.$modal.msgSuccess("修改成功"); - // this.open = false; - // this.getList(); - // }); - // } else { - // addUnitPrice(this.form).then(response => { - // this.$modal.msgSuccess("新增成功"); - // this.open = false; - // this.getList(); - // }); - // } + if (this.form.picId != null) { + updateUnitPrice(this.form).then(response => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); + } + // else { + // addUnitPrice(this.form).then(response => { + // this.$modal.msgSuccess("新增成功"); + // this.open = false; + // this.getList(); + // }); + // } } }); }, @@ -536,7 +557,7 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.download('system/unitPrice/export', { + this.download('mes/unitPrice/export', { ...this.queryParams }, `unitPrice_${new Date().getTime()}.xlsx`) }, @@ -570,14 +591,15 @@ export default { handleSearch() { console.log('Search triggered with input:', this.form.productCode); - listProduct(this.form).then(response => { - this.form.productName=response.rows[0].productDescZh; + let productCode=this.form.productCode; + getProductByCode(productCode).then(response => { + this.form.productName=response.data.productDescZh; }); }, - handleSelectChange(value,option) { + handleSelectChange(value) { // Add your logic here to handle the selection change - console.log(value,option) - // this.form.lineCode = value; + console.log(value) + this.form.lineCode = value; // this.form.lineName = selectedData; // You can perform any actions based on the selected value here. // For example, call a function or update some other data. diff --git a/src/views/mes/unitpriceReport/index.vue b/src/views/mes/unitpriceReport/index.vue new file mode 100644 index 0000000..ba68498 --- /dev/null +++ b/src/views/mes/unitpriceReport/index.vue @@ -0,0 +1,314 @@ + + +