物料附属属性

yangwl
陈恒杰 4 months ago
parent f94fd5708d
commit 2c89f511b6

@ -0,0 +1,45 @@
import request from '@/utils/request'
// import request from '@/api/attached'
// 查询物料附属信息列表
export function listAttached(query) {
return request({
url: '/mes/attached/list',
method: 'get',
params: query
})
}
// 查询物料附属信息详细
export function getAttached(id) {
return request({
url: '/mes/attached/' + id,
method: 'get'
})
}
// 新增物料附属信息
export function addAttached(data) {
return request({
url: '/mes/attached',
method: 'post',
data: data
})
}
// 修改物料附属信息
export function updateAttached(data) {
return request({
url: '/mes/attached',
method: 'put',
data: data
})
}
// 删除物料附属信息
export function delAttached(id) {
return request({
url: '/mes/attached/' + id,
method: 'delete'
})
}

@ -0,0 +1,471 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="产品编号" prop="productCode">
<el-input
v-model="queryParams.productCode"
placeholder="请输入产品编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="品类" prop="category">
<el-input
v-model="queryParams.category"
placeholder="请输入品类"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="每PC单圈" prop="pc">-->
<!-- <el-input-->
<!-- v-model="queryParams.pc"-->
<!-- placeholder="请输入每PC单圈"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="标准效率" prop="iei">
<el-input
v-model="queryParams.iei"
placeholder="请输入标准效率"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="标准用人" prop="manStandar">-->
<!-- <el-input-->
<!-- v-model="queryParams.manStandar"-->
<!-- placeholder="请输入标准用人"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="喷药方式" prop="sprayWay">-->
<!-- <el-input-->
<!-- v-model="queryParams.sprayWay"-->
<!-- placeholder="请输入喷药方式"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="白坯直径" prop="blankDiameter">-->
<!-- <el-input-->
<!-- v-model="queryParams.blankDiameter"-->
<!-- placeholder="请输入白坯直径"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="白坯物料号" prop="blankNo">-->
<!-- <el-input-->
<!-- v-model="queryParams.blankNo"-->
<!-- placeholder="请输入白坯物料号"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标准喷药量" prop="sprayVolume">-->
<!-- <el-input-->
<!-- v-model="queryParams.sprayVolume"-->
<!-- placeholder="请输入标准喷药量"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="药液料号" prop="liquidNo">-->
<!-- <el-input-->
<!-- v-model="queryParams.liquidNo"-->
<!-- placeholder="请输入药液料号"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标准内膜用量" prop="endometrialDosage">-->
<!-- <el-input-->
<!-- v-model="queryParams.endometrialDosage"-->
<!-- placeholder="请输入标准内膜用量"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标准外模用量(KG/PC)" prop="outerFilmDosage">-->
<!-- <el-input-->
<!-- v-model="queryParams.outerFilmDosage"-->
<!-- placeholder="请输入标准外模用量(KG/PC)"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="支架" prop="support">-->
<!-- <el-input-->
<!-- v-model="queryParams.support"-->
<!-- placeholder="请输入支架"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="支架物料号" prop="supportNo">-->
<!-- <el-input-->
<!-- v-model="queryParams.supportNo"-->
<!-- placeholder="请输入支架物料号"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="吸塑" prop="pvc">-->
<!-- <el-input-->
<!-- v-model="queryParams.pvc"-->
<!-- placeholder="请输入吸塑"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="支架盘" prop="supportPlate">-->
<!-- <el-input-->
<!-- v-model="queryParams.supportPlate"-->
<!-- placeholder="请输入支架盘"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="其它" prop="other">-->
<!-- <el-input-->
<!-- v-model="queryParams.other"-->
<!-- 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="['mes:attached: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:attached: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:attached: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:attached:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="attachedList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" />
<el-table-column label="产品编号" align="center" prop="productCode" />
<el-table-column label="品类" align="center" prop="category" />
<el-table-column label="每PC单圈" align="center" prop="pc" />
<el-table-column label="标准效率" align="center" prop="iei" />
<el-table-column label="标准用人" align="center" prop="manStandar" />
<el-table-column label="喷药方式" align="center" prop="sprayWay" />
<el-table-column label="白坯直径" align="center" prop="blankDiameter" />
<el-table-column label="白坯物料号" align="center" prop="blankNo" />
<el-table-column label="标准喷药量" align="center" prop="sprayVolume" />
<el-table-column label="药液料号" align="center" prop="liquidNo" />
<el-table-column label="标准内膜用量" align="center" prop="endometrialDosage" />
<el-table-column label="标准外模用量(KG/PC)" align="center" prop="outerFilmDosage" />
<el-table-column label="支架" align="center" prop="support" />
<el-table-column label="支架物料号" align="center" prop="supportNo" />
<el-table-column label="吸塑" align="center" prop="pvc" />
<el-table-column label="支架盘" align="center" prop="supportPlate" />
<el-table-column label="其它" align="center" prop="other" />
<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:attached:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:attached: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="产品编号" prop="productCode">
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
</el-form-item>
<el-form-item label="品类" prop="category">
<el-input v-model="form.category" placeholder="请输入品类" />
</el-form-item>
<el-form-item label="每PC单圈" prop="pc">
<el-input v-model="form.pc" placeholder="请输入每PC单圈" />
</el-form-item>
<el-form-item label="标准效率" prop="iei">
<el-input v-model="form.iei" placeholder="请输入标准效率" />
</el-form-item>
<el-form-item label="标准用人" prop="manStandar">
<el-input v-model="form.manStandar" placeholder="请输入标准用人" />
</el-form-item>
<el-form-item label="喷药方式" prop="sprayWay">
<el-input v-model="form.sprayWay" placeholder="请输入喷药方式" />
</el-form-item>
<el-form-item label="白坯直径" prop="blankDiameter">
<el-input v-model="form.blankDiameter" placeholder="请输入白坯直径" />
</el-form-item>
<el-form-item label="白坯物料号" prop="blankNo">
<el-input v-model="form.blankNo" placeholder="请输入白坯物料号" />
</el-form-item>
<el-form-item label="标准喷药量" prop="sprayVolume">
<el-input v-model="form.sprayVolume" placeholder="请输入标准喷药量" />
</el-form-item>
<el-form-item label="药液料号" prop="liquidNo">
<el-input v-model="form.liquidNo" placeholder="请输入药液料号" />
</el-form-item>
<el-form-item label="标准内膜用量" prop="endometrialDosage">
<el-input v-model="form.endometrialDosage" placeholder="请输入标准内膜用量" />
</el-form-item>
<el-form-item label="标准外模用量(KG/PC)" prop="outerFilmDosage">
<el-input v-model="form.outerFilmDosage" placeholder="请输入标准外模用量(KG/PC)" />
</el-form-item>
<el-form-item label="支架" prop="support">
<el-input v-model="form.support" placeholder="请输入支架" />
</el-form-item>
<el-form-item label="支架物料号" prop="supportNo">
<el-input v-model="form.supportNo" placeholder="请输入支架物料号" />
</el-form-item>
<el-form-item label="吸塑" prop="pvc">
<el-input v-model="form.pvc" placeholder="请输入吸塑" />
</el-form-item>
<el-form-item label="支架盘" prop="supportPlate">
<el-input v-model="form.supportPlate" placeholder="请输入支架盘" />
</el-form-item>
<el-form-item label="其它" prop="other">
<el-input v-model="form.other" 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 { listAttached, getAttached, delAttached, addAttached, updateAttached } from "@/api/mes/attached";
export default {
name: "Attached",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
attachedList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
productCode: null,
category: null,
pc: null,
iei: null,
manStandar: null,
sprayWay: null,
blankDiameter: null,
blankNo: null,
sprayVolume: null,
liquidNo: null,
endometrialDosage: null,
outerFilmDosage: null,
support: null,
supportNo: null,
pvc: null,
supportPlate: null,
other: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询物料附属信息列表 */
getList() {
this.loading = true;
listAttached(this.queryParams).then(response => {
this.attachedList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
productCode: null,
category: null,
pc: null,
iei: null,
manStandar: null,
sprayWay: null,
blankDiameter: null,
blankNo: null,
sprayVolume: null,
liquidNo: null,
endometrialDosage: null,
outerFilmDosage: null,
support: null,
supportNo: null,
pvc: null,
supportPlate: null,
other: null,
createBy: null
};
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
console.log("id:" + id)
getAttached(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改物料附属信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateAttached(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAttached(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除物料附属信息编号为"' + ids + '"的数据项?').then(function() {
return delAttached(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/attached/export', {
...this.queryParams
}, `attached_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save