2023-11-10 17:02:52 +08:00
|
|
|
<!--
|
|
|
|
* @Author: zhp
|
|
|
|
* @Date: 2023-11-06 15:15:30
|
2024-03-20 15:54:57 +08:00
|
|
|
* @LastEditTime: 2024-03-20 09:40:42
|
2023-11-10 17:02:52 +08:00
|
|
|
* @LastEditors: zhp
|
|
|
|
* @Description:
|
|
|
|
-->
|
|
|
|
<template>
|
2023-12-04 14:14:34 +08:00
|
|
|
<el-dialog :visible.sync="visible" width="50%">
|
2023-11-10 17:02:52 +08:00
|
|
|
<small-title slot="title" :no-padding="true">
|
|
|
|
{{ '详情' }}
|
|
|
|
</small-title>
|
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
|
|
|
label-width="auto">
|
|
|
|
<el-row :gutter="24">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item label="工单号" prop="workOrderId">
|
2024-02-28 10:54:44 +08:00
|
|
|
<el-select disabled v-model="dataForm.workOrderId" placeholder="请选择工单号">
|
2023-11-10 17:02:52 +08:00
|
|
|
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
2024-02-28 10:54:44 +08:00
|
|
|
<el-form-item label="数量" prop="num">
|
|
|
|
<el-input disabled v-model="dataForm.num" placeholder="请输入数量" />
|
2023-11-10 17:02:52 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
2024-02-28 10:54:44 +08:00
|
|
|
<el-form-item label="报废时间" prop="logTime">
|
|
|
|
<el-date-picker disabled v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
placeholder="选择日期">
|
|
|
|
</el-date-picker>
|
2023-11-10 17:02:52 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item label="产线" prop="lineId">
|
2024-02-28 10:54:44 +08:00
|
|
|
<el-select disabled v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
|
2023-11-10 17:02:52 +08:00
|
|
|
<el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
2024-02-28 10:54:44 +08:00
|
|
|
<el-form-item label="工段" prop="sectionId">
|
|
|
|
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" disabled>
|
|
|
|
<el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
2023-11-10 17:02:52 +08:00
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
2024-02-28 10:54:44 +08:00
|
|
|
<el-form-item label="报废原因" prop="detId">
|
|
|
|
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple disabled>
|
|
|
|
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
|
|
|
</el-select>
|
2023-11-10 17:02:52 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
2024-03-20 15:54:57 +08:00
|
|
|
<el-col :span="24">
|
2023-11-10 17:02:52 +08:00
|
|
|
<el-form-item label="描述" prop="description">
|
2024-03-20 15:54:57 +08:00
|
|
|
<el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
|
2023-11-10 17:02:52 +08:00
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
2024-03-20 15:54:57 +08:00
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
<el-input v-model="dataForm.remark" placeholder="备注" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
2023-11-10 17:02:52 +08:00
|
|
|
</el-form>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-03-01 15:27:01 +08:00
|
|
|
import basicAdd from './basic-add';
|
2023-11-10 17:02:52 +08:00
|
|
|
import {
|
|
|
|
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
|
|
|
|
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
|
|
|
|
import { getList,} from "@/api/base/qualityScrapType";
|
|
|
|
import SmallTitle from './SmallTitle';
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
SmallTitle,
|
|
|
|
},
|
|
|
|
mixins: [basicAdd],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
urlOptions: {
|
|
|
|
isGetCode: false,
|
|
|
|
// codeURL: getCode,
|
|
|
|
createURL: createQualityScrapLog,
|
|
|
|
updateURL: updateQualityScrapLog,
|
|
|
|
infoURL: getQualityScrapLog,
|
|
|
|
},
|
|
|
|
lineList:[],
|
|
|
|
typeList: [],
|
|
|
|
workOrderList: [],
|
|
|
|
detList:[],
|
|
|
|
teamList: [],
|
|
|
|
sourceList: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
name: '手动',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
name: '自动',
|
|
|
|
}
|
|
|
|
],
|
2024-03-18 16:00:56 +08:00
|
|
|
sectionList:[],
|
2023-12-04 14:14:34 +08:00
|
|
|
visible:false,
|
2023-11-10 17:02:52 +08:00
|
|
|
dataForm: {
|
|
|
|
id: undefined,
|
|
|
|
logTime: undefined,
|
|
|
|
source:1,
|
|
|
|
detId: undefined,
|
|
|
|
workOrderId: null,
|
|
|
|
teamId: undefined,
|
|
|
|
num: undefined,
|
|
|
|
lineId:undefined,
|
|
|
|
description:undefined,
|
|
|
|
// description: undefined,
|
|
|
|
remark: undefined,
|
|
|
|
},
|
|
|
|
// materialList: [],
|
|
|
|
dataRule: {
|
|
|
|
// materialId: [{ required: true, message: "", trigger: "blur" }],
|
|
|
|
workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
|
|
|
|
num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
|
|
|
|
detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
|
|
|
|
|
|
|
|
logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2023-12-04 14:14:34 +08:00
|
|
|
this.getDict()
|
2023-11-10 17:02:52 +08:00
|
|
|
console.log('我看看', this.dataForm)
|
2024-03-18 16:00:56 +08:00
|
|
|
// this.getCurrentTime()
|
2023-11-10 17:02:52 +08:00
|
|
|
},
|
|
|
|
methods: {
|
2023-12-04 14:14:34 +08:00
|
|
|
// init() {
|
|
|
|
// this.dialogVisible = true
|
|
|
|
// },
|
2024-03-18 16:00:56 +08:00
|
|
|
// getCurrentTime() {
|
|
|
|
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
|
|
|
// this.dataForm.logTime = new Date()
|
|
|
|
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
|
|
|
// console.log(this.dataForm.logTime);
|
|
|
|
// },
|
2024-03-01 15:27:01 +08:00
|
|
|
async getDict() {
|
|
|
|
// 物料列表
|
2023-12-04 14:14:34 +08:00
|
|
|
const res = await getList()
|
|
|
|
this.typeList = res.data
|
|
|
|
getWorkOrderList().then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
// console.log(response);
|
|
|
|
this.workOrderList = res.data.map((item) => {
|
|
|
|
return {
|
|
|
|
name: item.name,
|
|
|
|
id: item.id
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// console.log(this.formConfig[0].selectOptions);
|
|
|
|
// this.listQuery.total = response.data.total;
|
|
|
|
})
|
|
|
|
getLineList().then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
// console.log(response);
|
|
|
|
this.lineList = res.data.map((item) => {
|
|
|
|
return {
|
|
|
|
name: item.name,
|
|
|
|
id: item.id
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// console.log(this.formConfig[0].selectOptions);
|
|
|
|
// this.listQuery.total = response.data.total;
|
|
|
|
})
|
|
|
|
getDetList().then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
// console.log(response);
|
2024-03-01 15:27:01 +08:00
|
|
|
this.detList = res.data.map((item) => {
|
2023-12-04 14:14:34 +08:00
|
|
|
return {
|
2024-03-01 15:27:01 +08:00
|
|
|
name: item.content,
|
2023-12-04 14:14:34 +08:00
|
|
|
id: item.id
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// console.log(this.formConfig[0].selectOptions);
|
|
|
|
// this.listQuery.total = response.data.total;
|
|
|
|
})
|
|
|
|
getTeamList().then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
// console.log(response);
|
|
|
|
this.teamList = res.data.map((item) => {
|
|
|
|
return {
|
|
|
|
name: item.name,
|
|
|
|
id: item.id
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// console.log(this.formConfig[0].selectOptions);
|
|
|
|
// this.listQuery.total = response.data.total;
|
|
|
|
})
|
2024-02-28 10:54:44 +08:00
|
|
|
},
|
|
|
|
async getWorksectionById(lineId) {
|
2024-03-01 15:27:01 +08:00
|
|
|
if (lineId) {
|
2024-02-28 10:54:44 +08:00
|
|
|
const { code, data } = await this.$axios({
|
|
|
|
url: '/base/core-workshop-section/listByParentId',
|
|
|
|
method: 'get',
|
|
|
|
params: {
|
|
|
|
id: lineId,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
if (code == 0) {
|
|
|
|
console.log(data)
|
|
|
|
this.sectionList = data.map((item) => {
|
|
|
|
return {
|
|
|
|
name: item.name,
|
|
|
|
id: item.id,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
2024-03-01 15:27:01 +08:00
|
|
|
} else {
|
|
|
|
this.$axios({
|
|
|
|
url: '/base/core-workshop-section/listAll',
|
|
|
|
method: 'get',
|
|
|
|
// params: {
|
|
|
|
// id: lineId,
|
|
|
|
// },
|
|
|
|
}).then((res) => {
|
|
|
|
// console.log(data)
|
|
|
|
this.sectionList = res.data.map((item) => {
|
|
|
|
return {
|
|
|
|
name: item.name,
|
|
|
|
id: item.id,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
2023-11-10 17:02:52 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|