Merge remote-tracking branch 'origin/master'
commit
7ce36c0478
@ -0,0 +1,284 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||||
|
label-width="100px">
|
||||||
|
<el-form-item label="产品类型" prop="materialCode">
|
||||||
|
<el-select v-model="queryParams.prodType" placeholder="请选择" @change="changeTableType">
|
||||||
|
<el-option
|
||||||
|
v-for="item in tableTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品编号" prop="productCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.materialCode"
|
||||||
|
placeholder="请输入产品编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品名称" prop="productDescZh">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.productDescZh"
|
||||||
|
placeholder="请输入产品名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品英文名称" prop="productDescEn">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.productDescEn"
|
||||||
|
placeholder="请输入产品英文名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品名称" prop="productDescZh">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.productDescZh"
|
||||||
|
placeholder="请输入产品名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品类" prop="productGroupName" label-width="120px">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.productGroupName"
|
||||||
|
placeholder="请输入品类名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检验标准" prop="standarNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.standarNo"
|
||||||
|
placeholder="请输入检验标准"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间" prop="incomeTimeArray">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.incomeTimeArray"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
/>
|
||||||
|
</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="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="traceList" @selection-change="handleSelectionChange" height="500px">
|
||||||
|
<!-- 序号 -->
|
||||||
|
<el-table-column type="index" width="50" align="center" :index="indexMethod" label="序号" fixed/>
|
||||||
|
<el-table-column label="产品编码" width="110" align="center" prop="productCode" :formatter="productCodeFormate" fixed/>
|
||||||
|
<el-table-column label="产品名称" width="200" align="center" prop="productDescZh" :show-overflow-tooltip="true" fixed/>
|
||||||
|
<el-table-column label="产品英文名称" width="150" align="center" prop="productDescEn" :show-overflow-tooltip="true" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="最大批次数量" width="120" align="center" prop="batchMax" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="卡板装载量" width="110" align="center" prop="palletNum" />
|
||||||
|
<el-table-column label="箱码规格" width="120" align="center" prop="spec" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="品类" width="140" align="center" prop="productGroupName" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="子母单比例" width="100" align="center" prop="unity" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="检验标准" width="110" align="center" prop="standarNo"/>
|
||||||
|
<el-table-column label="箱型" width="50" align="center" prop="boxType" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="垛型" width="50" align="center" prop="packType" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="CPK品类" width="140" align="center" prop="cpkTypeName" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="产线分配" width="400" align="left" prop="lineNames" v-if="!showColumn"/>
|
||||||
|
<el-table-column label="检验周期" align="center" prop="warehouseCycle" v-if="showColumn"/>
|
||||||
|
<el-table-column label="区位" width="140" align="center" prop="waNames" v-if="showColumn"/>
|
||||||
|
<el-table-column label="最近7次上载MES时间" width="600" align="left" prop="onLineTimes" :show-overflow-tooltip="true"/>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getProductTraceList} from "@/api/mes/reportWorks";
|
||||||
|
import moment from "moment/moment";
|
||||||
|
export default {
|
||||||
|
name: "ProductTrace",
|
||||||
|
dicts: ["check_type","qms_category"],
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showColumn:false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
checkTypeList: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 物料CPK上下限维护表格数据
|
||||||
|
traceList: [],
|
||||||
|
projectNoOptions: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
typeCode: null,
|
||||||
|
checkType: null,
|
||||||
|
factoryCode: null,
|
||||||
|
materialCode: null,
|
||||||
|
materialName: null,
|
||||||
|
upVal: null,
|
||||||
|
downVal: null,
|
||||||
|
prodType: 'cp',
|
||||||
|
incomeTimeArray: [],
|
||||||
|
ymArrayStart: null,
|
||||||
|
ymArrayEnd: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {downVal:0,upVal:0},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
tableTypeOptions: [{
|
||||||
|
value: 'cp',
|
||||||
|
label: '成品'
|
||||||
|
}, {
|
||||||
|
value: 'bc',
|
||||||
|
label: '包材'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDate();
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**获取默认查询时间段**/
|
||||||
|
getDate() {
|
||||||
|
let start = this.Fungetdate(0);
|
||||||
|
let end = this.Fungetdate(1);
|
||||||
|
|
||||||
|
this.queryParams.incomeTimeArray.push(start, end);
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
Fungetdate(num) {
|
||||||
|
var dd = new Date();
|
||||||
|
dd.setDate(dd.getDate() + num);
|
||||||
|
var y = dd.getFullYear();
|
||||||
|
var m = dd.getMonth() + 1; //获取当前月份的日期
|
||||||
|
var d = dd.getDate();
|
||||||
|
return y + "-" + m + "-" + d;
|
||||||
|
},
|
||||||
|
|
||||||
|
changeTableType(val){
|
||||||
|
if(val == 'bc'){
|
||||||
|
this.showColumn = true;
|
||||||
|
}else{
|
||||||
|
this.showColumn = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询物料检验标准列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
|
if (this.queryParams.incomeTimeArray.length > 0) {
|
||||||
|
this.queryParams.ymArrayStart = moment(this.queryParams.incomeTimeArray[0]).format("YYYY-MM-DD");
|
||||||
|
this.queryParams.ymArrayEnd = moment(this.queryParams.incomeTimeArray[1]).format("YYYY-MM-DD");
|
||||||
|
}
|
||||||
|
|
||||||
|
getProductTraceList(this.queryParams).then(response => {
|
||||||
|
this.traceList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
typeCode: null,
|
||||||
|
checkType: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
factoryCode: null,
|
||||||
|
delFlag: null,
|
||||||
|
materialCode: null,
|
||||||
|
materialName: null,
|
||||||
|
upVal: null,
|
||||||
|
downVal: 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
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('mes/reportWorks/getProductTraceExport', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `productTrace_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
// 生成表头序号
|
||||||
|
indexMethod(index) {
|
||||||
|
return index + 1;
|
||||||
|
},
|
||||||
|
//产品编码格式化
|
||||||
|
productCodeFormate(row, column, cellValue) {
|
||||||
|
if (cellValue != null) {
|
||||||
|
return cellValue.slice(7, 18); //返回值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue