线体产品维护

yangwl
zhaoxiaolin 5 months ago
parent 60351eaade
commit 10f33fac3f

@ -24,18 +24,18 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标准用人" prop="useMan">
<el-form-item label="产品编码" prop="productCode">
<el-input
v-model="queryParams.useMan"
v-model="queryParams.productCode"
type="number"
placeholder="请输入标准用人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标准效率" prop="efficiency">
<el-form-item label="产品名称" prop="productName">
<el-input
v-model="queryParams.efficiency"
v-model="queryParams.productName"
type="number"
placeholder="请输入标准效率"
clearable
@ -103,6 +103,17 @@
>导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['mes:mesLine:export']"
>导入
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
@ -116,14 +127,15 @@
>
<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="productList" width="200"
:formatter="formatProductNames" :show-overflow-tooltip="true"/>
<el-table-column label="检验工具" align="center" prop="attr1" />
<el-table-column
<el-table-column label="线体编码" align="center" prop="lineCode" width="100"/>
<el-table-column label="线体名称" align="center" prop="lineName" width="100"/>
<el-table-column label="产品编码" align="center" prop="productCode" width="180" :formatter="productCodeFormate"/>
<el-table-column label="产品名称" align="center" prop="productName" width="350" />
<el-table-column label="标准用人" align="center" prop="useMan" width="100"/>
<el-table-column label="标准效率" align="center" prop="efficiency" width="100"/>
<el-table-column label="标准工时" align="center" prop="attr1" width="100"/>
<!--<el-table-column label="产品列表" align="left" prop="productList" :formatter="formatProductNames" :show-overflow-tooltip="true"/>-->
<el-table-column width="120"
label="操作"
align="center"
class-name="small-padding fixed-width"
@ -173,7 +185,18 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="productName">
<el-input v-model="form.productName" placeholder="请选择产品名称">
<el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产品编码" prop="productCode">
<el-input v-model="form.productCode" placeholder="请输入物料号" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8">
@ -187,65 +210,47 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检验工具" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入检验工具" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="24">
<el-form-item
v-for="(item, index) in processItems"
:label="'第' + (index+1) +'道工艺'"
:key="item.key"
:prop="'processItems.'+index+'.value'"
>
<el-input v-model="item.value" style="width: 35%;" placeholder="请输入工艺"></el-input>
<label for="dis-people" style="padding: 0 10px;">人员分配</label>
<el-input id="dis-people" type="number" v-model="item.quality" style="width: 30%;" placeholder="请输入数量"></el-input>
<el-button @click.prevent="removeProcessItem(item)" style="margin-left:30px">删除</el-button>
<el-form-item label="标准工时" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入标准工时" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleSelectProduct"
v-hasPermi="['mes:mesLine:add']"
>选择产品
</el-button>
</el-col>
</el-row>
<el-table v-loading="proloading" :data="form.productList" @selection-change="productSelectionChange" ref="myTable" >
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" label="序号" />
<el-table-column label="产品编码" align="center" prop="productCode" />
<el-table-column label="产品名称" align="center" prop="productName" />
<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-delete"
@click="deleteProduct(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</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>
<!-- 产线产品导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板
</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<ItemSelectMaterial
ref="itemSelectMaterial"
@onSelected="onSelectMaterial"
@ -263,10 +268,10 @@ import {
selectLineBody
} from "@/api/mes/mesLine";
import ItemSelectMaterial from "@/views/mes/mesLine/selectMaterial";
import {getToken} from "@/utils/auth";
export default {
name: "MesLine",
components: {ItemSelectMaterial,},
components: {ItemSelectMaterial},
data() {
return {
//
@ -305,7 +310,9 @@ export default {
factoryCode: null,
},
//
form: {},
form: {
productList: []
},
//
rules: {
useMan: [
@ -314,12 +321,30 @@ export default {
efficiency: [
{ required: true, message: "标准效率不能为空", trigger: "blur" },
],
attr1: [
{ required: true, message: "标准工时不能为空", trigger: "blur" },
],
},
processItems:[{
value: '',
key: Date.now(),
quality: 0
}],
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/mes/mesLine/importData"
},
};
},
created() {
@ -355,6 +380,7 @@ export default {
id: null,
lineCode: null,
lineName: null,
productCode: null,productName: null,
productList: [],
useMan: null,
efficiency: null,
@ -377,7 +403,8 @@ export default {
};
this.processItems=[{
value: '',
key: Date.now()
key: Date.now(),
quanlity: ''
}],
this.resetForm("form");
},
@ -422,7 +449,13 @@ export default {
};
});
this.form.processItems = this.processItems;
}
}else{
this.form.processItems=[{
value: '',
key: Date.now(),
quanlity: ''
}]
};
this.open = true;
this.title = "修改线体管理";
});
@ -481,19 +514,36 @@ export default {
},
`mesLine_${new Date().getTime()}.xlsx`
);
},
// -
handleImport() {
this.upload.title = "产线产品信息导入";
this.upload.open = true;
},
// -
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// -
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList();
},
// -
submitFileForm() {
this.$refs.upload.submit();
},
// -
importTemplate() {
this.download('/mes/mesLine/importTemplate', {}, `mes_product_template_${new Date().getTime()}.xlsx`)
},
//
onSelectMaterial(obj) {
obj.map(item => {
if(item.productCode) {
if(this.form.productList.some(e => e.productCode === item.productCode)) {
this.$modal.msgError("该物料已存在");
return;
}
this.form.productList.push(item);
}
})
console.log(this.form.productList);
this.form.productName = obj[0].productName;
this.form.productCode = obj[0].productCode;
},
deleteProduct(row) {
const productCode = row.productCode;
@ -543,7 +593,12 @@ export default {
return '';
}
},
//
productCodeFormate(row, column, cellValue) {
if (cellValue != null) {
return cellValue.slice(7, 18); //
}
},
},
};
</script>

@ -135,7 +135,12 @@ export default {
//
handleBomSelectionChange(selection) {
if(selection.length==1){
this.productList = selection;
}else{
this.$modal.msgSuccess("请选择一个产品");
}
},

Loading…
Cancel
Save