LAPTOP-R6EHHS26\86155 8 months ago
commit b2d8659e12

@ -0,0 +1,22 @@
import request from '@/utils/request'
export function getDefectValue(belongToDetail) {
return request({
url: '/quality/qcCheckTaskDefect/getDefectValue/' + belongToDetail,
method: 'get',
});
}
export function commitDefectValue(data) {
return request({
url: '/quality/qcCheckTaskDefect/commitDefectValue',
method: 'post',
data: data
});
}
export function updateDefectValue(data) {
return request({
url: '/quality/qcCheckTaskDefect/updateDefectValue',
method: 'put',
data: data
});
}

@ -173,4 +173,4 @@ export function getCkeckProjectXJList(query) {
method: 'get',
params: query
});
}
}

@ -222,9 +222,9 @@
</el-table-column>
<el-table-column width="120" label="车间" align="center" prop="workshop" />
<el-table-column width="120" label="组线" align="center" prop="groupLine" />
<el-table-column width="300" label="设备" align="center" prop="equipmentName" />
<el-table-column width="300" label="设备名称" align="left" prop="equipmentName" />
<el-table-column width="120" label="设备编码" align="center" prop="equipmentCode" />
<el-table-column width="100" label="故障时间" align="center" prop="faultTime" />
<el-table-column width="100" label="故障停机时间" align="center" prop="faultTime" />
<el-table-column width="100" label="实际运行时间" align="center" prop="actualOperationTime" />
<el-table-column width="100" label="运行时间" align="center" prop="operationTime" />
<el-table-column width="100" label="故障率" align="center" prop="failureRate" />

@ -197,7 +197,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device: repairOrder:remove']"
v-hasPermi="['device:repairOrder:remove']"
>删除</el-button
>
</el-col>
@ -261,7 +261,7 @@
label="维修单号"
align="center"
prop="workCode"
width="200"
width="220"
fixed
/>
<el-table-column
@ -283,6 +283,12 @@
prop="orderCode"
width="200"
/>
<el-table-column
label="设备名称"
align="center"
prop="equipmentName"
width="200"
/>
<el-table-column
label="设备编码"
align="center"
@ -455,6 +461,17 @@
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment">
</ItemSelect>
</el-form-item>
<el-form-item label="故障开始时间" prop="faultStartTime">
<el-date-picker
clearable
v-model="form.faultStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 280px"
placeholder="请选择故障开始时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="计划维修时间" prop="workPlanTime">
<el-date-picker
clearable
@ -527,6 +544,7 @@
<el-select
v-model="form.workFaultDesc"
@change="$forceUpdate()"
@blur="selectBlurworkFaultDesc"
clearable
filterable
style="width: 280px"
@ -859,8 +877,8 @@
<el-descriptions-item label="报修来源">{{
form.orderSource
}}</el-descriptions-item>
<el-descriptions-item label="报修时间">{{
form.orderTime
<el-descriptions-item label="故障报修时间">{{
form.orderBreakdownTime
}}</el-descriptions-item>
<el-descriptions-item label="报修人名字">{{
form.orderRepairmanName
@ -997,7 +1015,7 @@
<el-tab-pane label="填写维修记录">
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="维修人" prop="workPerson">
<el-form-item label="维修人" prop="workPerson" label-width="120px">
<el-input
v-model="form.workPerson"
placeholder="请选择维修人"
@ -1012,12 +1030,12 @@
<ItemSelectPerson
ref="itemSelectPerson"
@onSelected="onItemSelectedPerson"
>
>
</ItemSelectPerson>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修状态" prop="workStatus">
<el-form-item label="维修状态" prop="workStatus" label-width="120px">
<el-select
v-model="form.workStatus"
placeholder="请选择维修状态"
@ -1033,7 +1051,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修费用" prop="workCost">
<el-form-item label="维修费用" prop="workCost" label-width="120px">
<el-input-number
:min="0"
:step="1"
@ -1046,7 +1064,7 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="开始时间" prop="workStartTime">
<el-form-item label="开始时间" prop="workStartTime" label-width="120px">
<el-date-picker
clearable
v-model="form.workStartTime"
@ -1059,7 +1077,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结束时间" prop="workEndTime">
<el-form-item label="结束时间" prop="workEndTime" label-width="120px">
<el-date-picker
clearable
v-model="form.workEndTime"
@ -1072,7 +1090,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修用时" prop="workCostTime">
<el-form-item label="维修用时" prop="workCostTime" label-width="120px">
<el-input
v-model="form.workCostTime"
style="width: 250px"
@ -1084,7 +1102,41 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="是否停机" prop="workDownMachine">
<el-form-item label="故障报修时间" prop="orderBreakdownTime" v-if = "form.faultStartTime == null" label-width="120px">
<el-date-picker
clearable
v-model="form.orderBreakdownTime"
type="datetime"
style="width: 250px"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
></el-date-picker>
</el-form-item>
<el-form-item label="故障开始时间" prop="faultStartTime" v-if = "form.faultStartTime != null" label-width="120px">
<el-date-picker
clearable
v-model="form.faultStartTime"
type="datetime"
style="width: 250px"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="故障停机时间" prop="faultDownTime" label-width="120px">
<el-input
v-model="form.faultDownTime"
style="width: 250px"
disabled
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="是否停机" prop="workDownMachine" abel-width="120px">
<el-radio-group v-model="form.workDownMachine">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
@ -1104,7 +1156,7 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="故障原因" prop="workReason">
<el-form-item label="故障原因" prop="workReason" label-width="120px">
<el-select
v-model="form.workReason"
placeholder="请选择故障原因"
@ -1125,7 +1177,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="处理措施" prop="repairMeasures">
<el-form-item label="处理措施" prop="repairMeasures" label-width="120px">
<el-select
v-model="form.repairMeasures"
placeholder="请选择处理措施"
@ -1148,7 +1200,7 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="故障图片" prop="afterRepairFile">
<el-form-item label="故障图片" prop="afterRepairFile" label-width="120px">
<FileUpload v-model="form.afterRepairFile" />
</el-form-item>
</el-col>
@ -1217,8 +1269,8 @@
<el-descriptions-item label="报修来源">{{
form.orderSource
}}</el-descriptions-item>
<el-descriptions-item label="报修时间">{{
form.orderTime
<el-descriptions-item label="故障报修时间">{{
form.orderBreakdownTime
}}</el-descriptions-item>
<el-descriptions-item label="报修人名字">{{
form.orderRepairmanName
@ -1371,7 +1423,7 @@
<el-tab-pane label="查看维修记录">
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="维修人" prop="workPerson">
<el-form-item label="维修人" prop="workPerson" label-width="120px">
<el-input
v-model="form.workPerson"
style="width: 195px"
@ -1381,7 +1433,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修状态" prop="workStatus">
<el-form-item label="维修状态" prop="workStatus" label-width="120px">
<el-select
v-model="form.workStatus"
disabled
@ -1397,7 +1449,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修费用" prop="workCost">
<el-form-item label="维修费用" prop="workCost" label-width="120px">
<el-input-number
:min="0"
:step="1"
@ -1411,7 +1463,7 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="开始时间" prop="workStartTime">
<el-form-item label="开始时间" prop="workStartTime" label-width="120px">
<el-date-picker
clearable
v-model="form.workStartTime"
@ -1424,7 +1476,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结束时间" prop="workEndTime">
<el-form-item label="结束时间" prop="workEndTime" label-width="120px">
<el-date-picker
clearable
v-model="form.workEndTime"
@ -1437,7 +1489,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修用时" prop="workCostTime">
<el-form-item label="维修用时" prop="workCostTime" label-width="120px">
<el-input
v-model="form.workCostTime"
style="width: 195px"
@ -1449,7 +1501,41 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="是否停机" prop="workDownMachine">
<el-form-item label="故障报修时间" prop="orderBreakdownTime" v-if = "form.faultStartTime == null" label-width="120px">
<el-date-picker
clearable
v-model="form.orderBreakdownTime"
type="datetime"
style="width: 195px"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
></el-date-picker>
</el-form-item>
<el-form-item label="故障开始时间" prop="faultStartTime" v-if = "form.faultStartTime != null" label-width="120px">
<el-date-picker
clearable
v-model="form.faultStartTime"
type="datetime"
style="width: 195px"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="故障停机时间" prop="faultDownTime" label-width="120px">
<el-input
v-model="form.faultDownTime"
style="width: 195px"
disabled
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="是否停机" prop="workDownMachine" label-width="120px">
<el-radio-group v-model="form.workDownMachine" disabled>
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
@ -1470,14 +1556,14 @@
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="故障原因" prop="workReason">
<el-form-item label="故障原因" prop="workReason" label-width="120px">
<el-select
v-model="form.workReason"
@change="$forceUpdate()"
disabled
clearable
filterable
style="width: 250px"
style="width: 195px"
@keyup.enter.native="handleQuery"
>
<el-option
@ -1490,14 +1576,14 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="处理措施" prop="repairMeasures">
<el-form-item label="处理措施" prop="repairMeasures" label-width="120px">
<el-select
v-model="form.repairMeasures"
@change="$forceUpdate()"
clearable
filterable
disabled
style="width: 250px"
style="width: 195px"
@keyup.enter.native="handleQuery"
>
<el-option
@ -1742,6 +1828,26 @@ export default {
outSourcePerson: [
{ required: true, message: "委外维修人员不能为空", trigger: "blur" },
],
//
equipmentCode: [
{ required: true, message: "设备编码不能为空", trigger: "blur" },
],
workPlanDownTime: [
{ required: true, message: "计划维修时间不能为空", trigger: "blur" },
],
faultStartTime: [
{ required: true, message: "故障开始时间不能为空", trigger: "blur" },
],
workDownMachine: [
{ required: true, message: "是否停机维修不能为空", trigger: "blur" },
],
workFaultDesc: [
{ required: true, message: "故障描述不能为空", trigger: "blur" },
],
workTeam: [
{ required: true, message: "故障组不能为空", trigger: "blur" },
],
},
};
},
@ -1758,7 +1864,8 @@ export default {
indexMethod(index) {
return index + 1;
},
// -
// -
listeningTime() {
if (this.form.workEndTime != null && this.form.workStartTime != null) {
var time1 = moment(this.form.workStartTime);
@ -1775,6 +1882,37 @@ export default {
_data.seconds / 3600
).toFixed(1) + "小时";
}
//
if (this.form.orderBreakdownTime != null && this.form.workEndTime != null && this.form.workDownMachine == 1) {
var time1 = moment(this.form.orderBreakdownTime);
var time2 = moment(this.form.workEndTime);
let duration = moment.duration(time2.diff(time1));
let { _data } = duration;
console.log("打印故障停机时间", _data);
//
this.form.faultDownTime =
(
_data.days * 24 +
_data.hours +
_data.minutes / 60 +
_data.seconds / 3600
).toFixed(1) + "小时";
}else if(this.form.faultStartTime != null && this.form.workEndTime != null && this.form.workDownMachine == 1){
var time1 = moment(this.form.faultStartTime);
var time2 = moment(this.form.workEndTime);
let duration = moment.duration(time2.diff(time1));
let { _data } = duration;
console.log("打印故障停机时间", _data);
//
this.form.faultDownTime =
(
_data.days * 24 +
_data.hours +
_data.minutes / 60 +
_data.seconds / 3600
).toFixed(1) + "小时";
}
},
// -
// listeningTime() {
@ -1800,6 +1938,7 @@ export default {
// "";
// }
// },
/** 查询维修工单列表 */
getList() {
this.loading = true;
@ -1826,6 +1965,11 @@ export default {
this.form.repairMeasures = even.target.value;
}
},
selectBlurworkFaultDesc(even) {
if (even.target.value) {
this.form.workFaultDesc = even.target.value;
}
},
/** 查询维修原因列表 */
getWorkReason() {
this.loading = true;

@ -122,6 +122,7 @@
<el-table-column label="产品名称" align="center" prop="productName" width="220" :show-overflow-tooltip="true" />
<el-table-column label="排产数量" align="center" prop="quantity" width="100" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="班次" align="center" prop="shiftName" />
<el-table-column label="累计报工数量" align="center" prop="quantityFeedback" width="100" />
<!--<el-table-column label="用人数" align="center" prop="useMan" width="100"/>-->
<el-table-column label="累计工时" align="center" prop="workTime" />

@ -822,7 +822,7 @@ export default {
}else{
return cellValue; //
}
},
// -
@ -1322,8 +1322,8 @@ export default {
var statusesArray = this.statuses;
for (var i = 0; i < statusesArray.length; i++) {
if (statusesArray[i] == 'w1') {//
this.$modal.msgError("已经下达的订单不允许操作");
if (statusesArray[i] != 'w0') {//
this.$modal.msgError("已经派发的订单不允许操作");
return
}
}

@ -114,7 +114,7 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="检验规则编码" width="100" align="center" prop="projectNo" />
<el-table-column label="检验规则编码" width="110" align="center" prop="projectNo" />
<el-table-column label="检验规则名称" align="left" prop="ruleName" :show-overflow-tooltip="true" width="250"/>
<el-table-column label="标准值" align="left" prop="standardValue" :show-overflow-tooltip="true" width="250"/>
<el-table-column label="上差值" align="left" prop="upperDiff" />

@ -40,14 +40,13 @@
</el-table-column>
<el-table-column label="不良类型" align="left" prop="defectCode" width="120">
<template slot-scope="scope">
<el-select v-model="scope.row.defectCode" placeholder="检验结果" clearable>
<el-option
v-for="(item,index) in defectList"
:key="index"
:label="item.defectSubclass"
:value="item.defectCode"
/>
</el-select>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDefectType(scope.row)"
v-hasPermi="['quality:qcIncome:edit']"
>不良数量</el-button>
</template>
</el-table-column>
<el-table-column label="不良数量" align="left" prop="defectQuality" width="120">
@ -113,11 +112,32 @@
</el-form-item>
</el-form>
</el-dialog>
<el-dialog title="不良类型" :visible.sync="defectOpen" width="600px" append-to-body>
<el-form :model="defectForm" ref="defectForm" label-width="100px" class="demo-dynamic">
<el-form-item
v-for="(item, index) in defectForm.defectItems"
:label="item.defectSubclass"
:key="index"
:prop="`defectItems.${index}.noOkQuality`"
:rules="{
required: true, message: '不良类型不能为空', trigger: 'blur'
}"
>
<el-input type="number" v-model="item.noOkQuality" placeholder="请输入不良数量" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitDefectForm('defectForm')"></el-button>
<el-button @click="resetDefectForm('defectForm')"></el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult,getDefectList } from "@/api/quality/income";
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult,getDefectList} from "@/api/quality/income";
import { getDefectValue, commitDefectValue, updateDefectValue} from "@/api/quality/checkTaskDefect";
export default {
name: "itemSelectUser",
dicts: ["check_result","qc_rule_prop"],
@ -162,8 +182,28 @@ export default {
valueOpen: false,
//id
recordId:'',
typeCode:'',//
defectList:[]//
//belongTo
belongTo:'',
//
typeCode:'',
//
defectOpen: false,
updateFlag: false,
//
defectList:[],
defectForm: {
defectItems: [
{defectSubclass: '',
defectCode: '',
noOkQuality: 0,
belongToDetail: '',
belongTo: ''
}
]
},
};
},
created() {
@ -174,6 +214,11 @@ export default {
getDefect(){
getDefectList(this.typeCode).then(response => {
this.defectList = response;
this.defectForm.defectItems = this.defectList.map(item => ({
defectSubclass: item.defectSubclass,
defectCode: item.defectCode,
noOkQuality: 0
}));
});
},
@ -227,13 +272,13 @@ export default {
},
getAllRowData() {
const rowArray = this.$refs.myTable.data;
this.rowData = rowArray.map(obj => {
const found = this.defectList.find(subObj => subObj.defectCode === obj.defectCode);
if (found) {
return { ...obj, defectSubclass: found.defectSubclass };
} else {
this.rowData = rowArray.map(obj => {
const found = this.defectList.find(subObj => subObj.defectCode === obj.defectCode);
if (found) {
return { ...obj, defectSubclass: found.defectSubclass };
} else {
return obj;
}
}
});
},
@ -281,6 +326,28 @@ export default {
this.valueOpen = true;
this.recordId = row.recordId;
},
/** 不良类型弹窗 */
handleDefectType(row) {
this.defectForm.defectItems.forEach(item => {
item.belongToDetail = row.recordId;
item.belongTo = row.belongTo;
});
getDefectValue(row.recordId).then(response => {
let values = response.rows;
if(values.length > 0){
this.defectForm.defectItems = values.map(item => ({
//qc_check_task_defectrecordId
recordId: item.recordId,
defectSubclass: item.defectSubclass,
defectCode: item.defectCode,
noOkQuality: item.noOkQuality,
}));
this.updateFlag = true;
}
this.defectOpen = true;
});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
@ -312,6 +379,51 @@ export default {
value: '',
key: Date.now()
});
},
submitDefectForm() {
this.$refs.defectForm.validate((valid) => {
// 使 defectForm.defectItems
const formData = this.defectForm.defectItems;
if (valid) {
//
if(!this.updateFlag) {
commitDefectValue(formData).then(response => {
if(response.code === 200) {
this.$modal.msgSuccess("提交成功");
}else {
this.$modal.msgError(response.msg);
}
this.defectForm.defectItems = [];
this.defectOpen = false;
this.getDefect();
});
}else {
console.log(formData);
updateDefectValue(formData).then(response => {
if(response.code === 200) {
this.$modal.msgSuccess("修改成功");
}else {
this.$modal.msgError(response.msg);
}
this.defectForm.defectItems = [];
this.defectOpen = false;
this.getDefect();
});
}
} else {
//
console.log('error submit!!');
return false;
}
});
},
resetDefectForm() {
this.$refs.defectForm.resetFields();
// defectForm.defectItems noOkQuality
this.defectForm.defectItems.forEach(item => (item.noOkQuality = 0));
}
}
};

@ -1711,9 +1711,13 @@ export default {
this.auxiliaryEquipmentRightList;
this.form.rightData = this.rightList;
addEquipment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
if(response.code == 500){
this.$modal.message("新增失败");
}else if(response.code == 200){
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}

Loading…
Cancel
Save