| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-card class="box-card"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="产品编码" prop="productCode"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> |
| | | <el-form-item label="发动机编码" prop="sfcCode"> |
| | | <el-input |
| | | v-model="queryParams.productCode" |
| | | placeholder="请输入产品编码" |
| | | v-model="queryParams.sfcCode" |
| | | placeholder="请输入发动机编码" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" prop="productName"> |
| | | <el-form-item label="工位编号" prop="locationCode"> |
| | | <el-input |
| | | v-model="queryParams.productName" |
| | | placeholder="请输入产品名称" |
| | | v-model="queryParams.locationCode" |
| | | placeholder="请输入工位编号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="日期范围" prop="dateConditions"> |
| | | <el-date-picker |
| | | v-model="queryParams.dateConditions" |
| | | type="daterange" |
| | | align="right" |
| | | unlink-panels |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="yyyy-MM-dd" |
| | | @change="handleDateChange"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | |
| | | |
| | | <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0"> |
| | | <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="workOrderNo"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.workOrderNo"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="总成序列号" align="center" width="100" prop="sfcCode"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sfcCode"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="产品编号" align="center" prop="productCode"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.productCode"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="产线编号" align="center" prop="productionLine"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.productionLine"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="工位编号" align="center" prop="locationCode"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.locationCode"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="设备编号" align="center" prop="equipmentNo"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.equipmentNo"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="参数编码" align="center" prop="paramCode"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramCode"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="参数值" align="center" prop="paramValue"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramValue"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="参数上限" align="center" prop="paramUpper"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramUpper"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="参数下限" align="center" prop="paramLower"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramLower"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="标准值" align="center" prop="paramStandard"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramStandard"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="采集时间" align="center" prop="collectionTime" width="180"> |
| | | <!-- <el-table-column label="工单编号" align="center" prop="workOrderNo"></el-table-column>--> |
| | | <el-table-column label="发动机编码" align="center" width="160" prop="sfcCode" ></el-table-column> |
| | | <!-- <el-table-column label="产品编号" align="center" prop="productCode"></el-table-column>--> |
| | | <!-- <el-table-column label="产线编号" align="center" prop="productionLine"></el-table-column>--> |
| | | <!-- <el-table-column label="设备编号" align="center" prop="equipmentNo"></el-table-column>--> |
| | | <el-table-column label="参数名称" align="center" prop="paramName" width="150" ></el-table-column> |
| | | <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column> |
| | | <el-table-column label="工位编号" align="center" prop="locationCode"></el-table-column> |
| | | <el-table-column label="参数上限" align="center" prop="paramUpper"></el-table-column> |
| | | <el-table-column label="参数下限" align="center" prop="paramLower"></el-table-column> |
| | | <el-table-column label="采集时间" align="center" prop="collectionTime" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span> |
| | | <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center" prop="state"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.state"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="参数名称" align="center" prop="paramName"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramName"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center" prop="unit"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.unit"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="类型" align="center" prop="type"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.type"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <el-table-column label="状态" align="center" prop="state"></el-table-column> |
| | | <el-table-column label="参数编码" align="center" prop="paramCode"></el-table-column> |
| | | <el-table-column label="单位" align="center" prop="unit"></el-table-column> |
| | | <el-table-column label="类型" align="center" prop="type"></el-table-column> |
| | | <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | type="success" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['main:paramCollection:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | type="danger" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['main:paramCollection:remove']" |
| | |
| | | <!-- 添加或修改设备产品过程参数采集对话框 --> |
| | | <el-dialog v-dialogpop-up :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="workOrderNo"> |
| | | <el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="总成序列号" prop="sfcCode"> |
| | | <!-- <el-form-item label="工单编号" prop="workOrderNo">--> |
| | | <!-- <el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="发动机编码" prop="sfcCode"> |
| | | <el-input v-model="form.sfcCode" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品编号" prop="productCode"> |
| | | <el-input v-model="form.productCode" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="产线编号" prop="productionLine"> |
| | | <el-input v-model="form.productionLine" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="产线编号" prop="productionLine">--> |
| | | <!-- <el-input v-model="form.productionLine" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="工位编号" prop="locationCode"> |
| | | <el-input v-model="form.locationCode" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="设备编号" prop="equipmentNo"> |
| | | <el-input v-model="form.equipmentNo" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="设备编号" prop="equipmentNo">--> |
| | | <!-- <el-input v-model="form.equipmentNo" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="参数编码" prop="paramCode"> |
| | | <el-input v-model="form.paramCode" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="标准值" prop="paramStandard"> |
| | | <el-input v-model="form.paramStandard" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | <el-form-item label="采集时间" prop="collectionTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.collectionTime" |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="请选择采集时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="预留字段1" prop="spareField1">--> |
| | | <!-- <el-input v-model="form.spareField1" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="预留字段2" prop="spareField2">--> |
| | | <!-- <el-input v-model="form.spareField2" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="创建用户" prop="createUser">--> |
| | | <!-- <el-input v-model="form.createUser" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="更改用户" prop="updateUser">--> |
| | | <!-- <el-input v-model="form.updateUser" type="textarea" placeholder="请输入内容" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="状态" prop="state"> |
| | | <el-input v-model="form.state" placeholder="请输入状态" /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="类型" prop="type"> |
| | | <el-select v-model="form.type" placeholder="请选择类型"> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="dict.value"--> |
| | | <!-- ></el-option>--> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | |
| | | <script> |
| | | import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection"; |
| | | import {queryDaParamCollectionListForSearch} from "../../../../api/main/da/paramCollection/paramCollection"; |
| | | |
| | | export default { |
| | | name: "ParamCollection", |
| | | data() { |
| | | return { |
| | | maxDate: '', |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | |
| | | open: false, |
| | | // 查询参数 |
| | | queryParams: { |
| | | dateConditions: [], |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | workOrderNo: null, |
| | |
| | | id: [ |
| | | { required: true, message: "主键id不能为空", trigger: "blur" } |
| | | ], |
| | | workOrderNo: [ |
| | | { required: true, message: "工单编号不能为空", trigger: "blur" } |
| | | ], |
| | | // workOrderNo: [ |
| | | // { required: true, message: "工单编号不能为空", trigger: "blur" } |
| | | // ], |
| | | sfcCode: [ |
| | | { required: true, message: "总成序列号不能为空", trigger: "blur" } |
| | | ], |
| | | productCode: [ |
| | | { required: true, message: "产品编号不能为空", trigger: "blur" } |
| | | ], |
| | | productionLine: [ |
| | | { required: true, message: "产线编号不能为空", trigger: "blur" } |
| | | ], |
| | | // productionLine: [ |
| | | // { required: true, message: "产线编号不能为空", trigger: "blur" } |
| | | // ], |
| | | locationCode: [ |
| | | { required: true, message: "工位编号不能为空", trigger: "blur" } |
| | | ], |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | // this.getList(); |
| | | }, |
| | | methods: { |
| | | handleDateChange(value) { |
| | | if (value && value.length === 2) { |
| | | const startDate = value[0]; |
| | | const endDate = value[1]; |
| | | const dayCount = this.daysBetween(startDate, endDate); |
| | | if (dayCount + 1 > 7) { |
| | | this.$message.error('请选择连续的7天!'); |
| | | this.queryParams.dateConditions = []; // 重置日期范围 |
| | | } |
| | | } |
| | | }, |
| | | daysBetween(startDate, endDate) { |
| | | const oneDay = 24 * 60 * 60 * 1000; // 每天的毫秒数 |
| | | const startTime = new Date(startDate).getTime(); |
| | | const endTime = new Date(endDate).getTime(); |
| | | return Math.round(Math.abs((startTime - endTime) / oneDay)); |
| | | }, |
| | | /** 查询设备产品过程参数采集列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listParamCollection(this.queryParams).then(response => { |
| | | this.paramCollectionList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | if ((this.queryParams.sfcCode == null || this.queryParams.sfcCode === '') && this.queryParams.dateConditions.length === 0){ |
| | | this.$message({ |
| | | message: '请输入发动机号码或者选择查询日期', |
| | | type: 'info' |
| | | }); |
| | | } else { |
| | | queryDaParamCollectionListForSearch(this.queryParams).then(response => { |
| | | this.paramCollectionList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |