Merge remote-tracking branch 'origin/master'

master
mengjiao 8 months ago
commit 08e1474dbe

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询线体管理列表
export function listMesLine(query) {
return request({
url: '/mes/mesLine/list',
method: 'get',
params: query
});
}
// 查询线体管理详细
export function getMesLine(id) {
return request({
url: '/mes/mesLine/' + id,
method: 'get'
});
}
// 新增线体管理
export function addMesLine(data) {
return request({
url: '/mes/mesLine',
method: 'post',
data: data
});
}
// 修改线体管理
export function updateMesLine(data) {
return request({
url: '/mes/mesLine',
method: 'put',
data: data
});
}
// 删除线体管理
export function delMesLine(id) {
return request({
url: '/mes/mesLine/' + id,
method: 'delete'
});
}
//线体获取
export function getLineBodyList(query) {
return request({
url: '/mes/mesLine/selectLineBody',
method: 'get',
params: query
});
}

@ -0,0 +1,423 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="线体编码" prop="lineCode">
<el-input
v-model="queryParams.lineCode"
placeholder="请输入线体编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="线体名称" prop="lineName">
<el-input
v-model="queryParams.lineName"
placeholder="请输入线体名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标准用人" prop="useMan">
<el-input
v-model="queryParams.useMan"
type="number"
placeholder="请输入标准用人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标准效率(%)" prop="efficiency">
<el-input
v-model="queryParams.efficiency"
type="number"
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="handleAddLineBody"
v-hasPermi="['mes:mesLine: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="['mes:mesLine: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="['mes:mesLine: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="['mes:mesLine:export']"
>导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="mesLineList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" align="center" />
<el-table-column label="线体编码" align="center" prop="lineCode" />
<el-table-column label="线体名称" align="center" prop="lineName" />
<el-table-column label="标准用人" align="center" prop="useMan" />
<el-table-column label="标准效率(%)" align="center" prop="efficiency" />
<el-table-column label="检验工具" align="center" prop="attr1" />
<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="['mes:mesLine:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:mesLine: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="100px">
<el-form-item label="标准用人" prop="useMan">
<el-input v-model="form.useMan" type="number" placeholder="请输入标准用人" />
</el-form-item>
<el-form-item label="标准效率(%)" prop="efficiency">
<el-input v-model="form.efficiency" type="number" placeholder="请输入标准效率" />
</el-form-item>
<el-form-item label="检验工具" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入检验工具" />
</el-form-item>
<el-form-item
v-for="(item, index) in processItems"
:label="'第' + (index+1) +'道工艺'"
:key="item.key"
:prop="'processItems.'+index+'.value'"
:rules="{required: true, message: '请输入工艺', trigger: 'blur'}"
>
<el-input v-model="item.value" style="width: 70%;" placeholder="请输入工艺"></el-input>
<el-button @click.prevent="removeProcessItem(item)" style="margin-left:30px">删除</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="addProcessItem"></el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<SelectMesLine ref="selectMesLine" @onSelected="onSelectLineBody">
</SelectMesLine>
</div>
</template>
<script>
import {
listMesLine,
getMesLine,
delMesLine,
addMesLine,
updateMesLine,
} from "@/api/mes/mesLine";
import SelectMesLine from "./selectMesLine";
export default {
name: "MesLine",
components: {SelectMesLine,},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 线
mesLineList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
lineCode: null,
lineName: null,
useMan: null,
efficiency: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
factoryCode: null,
},
//
form: {},
//
rules: {
useMan: [
{ required: true, message: "标准用人不能为空", trigger: "blur" },
],
efficiency: [
{ required: true, message: "标准效率不能为空", trigger: "blur" },
],
},
processItems:[{
value: '',
key: Date.now()
}],
};
},
created() {
this.getList();
},
methods: {
/** 查询线体管理列表 */
getList() {
this.loading = true;
listMesLine(this.queryParams).then((response) => {
this.mesLineList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
lineCode: null,
lineName: null,
useMan: null,
efficiency: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
processList: [],
processItems: [{
value: '',
key: Date.now()
}],
};
this.processItems=[{
value: '',
key: Date.now()
}],
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加线体管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getMesLine(id).then((response) => {
this.form = response.data;
if (response.data.processList !== null) {
this.processItems = response.data.processList.map(item => {
return {
value: item,
key: Date.now(),
};
});
this.form.processItems = this.processItems;
}
this.open = true;
this.title = "修改线体管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
this.form.processList = this.form.processItems.map(item => item.value);
updateMesLine(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMesLine(this.form).then((response) => {
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除线体编号为"' + ids + '"的数据项?')
.then(function () {
return delMesLine(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/mesLine/export",
{
...this.queryParams,
},
`mesLine_${new Date().getTime()}.xlsx`
);
},
handleAddLineBody() {
this.$refs.selectMesLine.showFlag = true;
},
onSelectLineBody(obj) {
console.log(obj);
this.form.lineCode = obj.code;
this.form.lineName = obj.name;
addMesLine(this.form).then((response) => {
if(response.code == 200) {
this.$modal.msgSuccess("添加成功");
}else {
this.$modal.msgError(response.msg);
}
this.getList();
});
},
//
addProcessItem() {
this.processItems.push({
value: '',
key: Date.now()
});
this.form.processItems = this.processItems;
},
//
removeProcessItem(item) {
var index = this.processItems.indexOf(item)
if (index !== -1) {
this.processItems.splice(index, 1)
}
this.form.processItems = this.processItems;
},
},
};
</script>

@ -0,0 +1,145 @@
<template>
<el-dialog title="线体选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<!--BOM数据-->
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="线体编码" prop="lineCode">
<el-input
v-model="queryParams.lineCode"
placeholder="请输入线体编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="线体名称" prop="lineName">
<el-input
v-model="queryParams.lineName"
placeholder="请输入线体名称"
clearable
style="width: 240px"
@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-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" label="序号"></el-table-column>
<el-table-column label="线体编码" align="center" key="lineCode" prop="lineCode" :show-overflow-tooltip="true" />
<el-table-column label="线体名称" align="center" key="lineName" prop="lineName" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {getLineBodyList } from "@/api/mes/mesLine";
export default {
name: "selectMesLine",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: false,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
lineCode: '',
lineName : ''
},
};
},
created() {
this.getList();
},
methods: {
handleEquipmentSelectionChange (val) {
this.itemList = val
},
/** 查询BOM列表*/
getList() {
this.loading = true;
getLineBodyList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.ids = selection[0].lineCode;
this.idsName = selection[0].lineName;
},
submitBomForm() {
this.selectedRows.code = this.ids;
this.selectedRows.name = this.idsName;
this.$emit('onSelected', this.selectedRows);
this.showFlag = false;
}
}
};
</script>

@ -73,6 +73,14 @@
/>
</template>
</el-table-column>
<el-table-column label="二级类型" align="center" prop="attr1" width="150">
<template slot-scope="scope">
<dict-tag
:options="dict.type.order_type_ll"
:value="scope.row.attr1"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -138,6 +146,20 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item v-if="form.typeCode=='material'" label="来料类别" prop="attr1">
<el-select v-model="form.attr1" placeholder="请输入来料类别" >
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -184,7 +206,7 @@ import{ getSelectedUsers, addUserBind,deleteByMaterialCode} from "@/api/quality/
import ItemSelectUser from "./selectUser.vue";
export default {
name: "CheckType",
dicts: ["check_type"],
dicts: ["check_type","order_type_ll"],
components: {
ItemSelectUser
},
@ -202,6 +224,9 @@ export default {
//
showSearch: true,
openUserBind: false,
materialCode: "",
materialName: "",
attr1: "",
//
total: 0,
//
@ -352,12 +377,13 @@ export default {
//this.reset();
this.userloading = true;
let sr = row;
//
//使
this.materialCode = sr.orderCode;
this.materialName = sr.checkName;
this.attr1 = sr.attr1;
this.getUserParams.materialCode = sr.orderCode;
//
//
getSelectedUsers(this.getUserParams).then(response => {
this.userList = response.rows;
this.openUserBind = true;
@ -398,6 +424,7 @@ export default {
let data = {
materialCode: this.materialCode,
materialName: this.materialName,
attr1: this.attr1,
userCodes: [],
userNames: [],
}

@ -17,6 +17,16 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="来料类别" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择来料类别" clearable style="width: 100%;">
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料号" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
@ -150,6 +160,11 @@
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="供应商编码" align="center" prop="supplierCode" width="120"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/>
<el-table-column label="来料类别" align="center" prop="orderType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.order_type_ll" :value="scope.row.orderType" />
</template>
</el-table-column>
<el-table-column label="来料时间" align="center" prop="incomeTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.incomeTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
@ -217,12 +232,12 @@
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="检验任务编号" prop="checkNo">
<el-input v-model="form.checkNo" placeholder="请输入检验任务编号" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="检验类型" prop="checkType" >
<el-select v-model="form.checkType" placeholder="请选择检验类型" style="width: 100%;">
<el-option
@ -234,7 +249,19 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="来料类型" prop="orderType" >
<el-select v-model="form.orderType" placeholder="请选择检验类型" style="width: 100%;">
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="订单号" prop="orderNo">
<el-input v-model="form.orderNo" placeholder="请输入订单号">
<el-button slot="append" @click="handleSelectWorkOrder" icon="el-icon-search"></el-button>
@ -373,7 +400,7 @@ import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js";
export default {
name: "Income",
components: { ItemSelectWorkOrder,ItemSelectSupplier,ItemSelectUser,ItemSelectProject},
dicts: ["unit","check_status","check_result"],
dicts: ["unit","check_status","check_result","order_type_ll"],
data() {
return {
//
@ -457,11 +484,9 @@ export default {
checkManName: [
{ required: true, message: "检测人不能为空", trigger: "blur" }
],
/**
checkLoc: [
{ required: true, message: "检测地点不能为空", trigger: "blur" }
],
**/
orderType: [
{ required: true, message: "来料类型不能为空", trigger: "blur" }
]
}
};
},

@ -345,9 +345,10 @@
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" />
</el-form-item> -->
<el-form-item label="报工汇率" prop="reportRate">
<el-input
<el-input-number
:min="0"
:step="1"
v-model="form.reportRate"
placeholder="请输入报工汇率"
style="width: 320px"
/>
</el-form-item>

Loading…
Cancel
Save