Compare commits

..

No commits in common. "60edd8f2c40af68bfbb3cd8e0d57203b0ec9b73f" and "d0adf3a63edacfc749f1123f59845deecc0d801c" have entirely different histories.

9 changed files with 783 additions and 1017 deletions

View File

@ -14,7 +14,6 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.33:48082' VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082' # VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.1.101:48082' VUE_APP_JIMU_API = 'http://192.168.1.101:48082'

View File

@ -6,144 +6,79 @@
* @Description: * @Description:
--> -->
<template> <template>
<el-form <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
:model="dataForm" <el-row :gutter="20">
:rules="dataRule" <el-col :span="8">
ref="dataForm" <el-form-item label="工单号" prop="workOrderId">
@keyup.enter.native="dataFormSubmit()" <el-select filterable v-model="dataForm.workOrderId" placeholder="请选择工单号">
label-width="auto"> <el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
<el-row :gutter="20"> </el-select>
<el-col :span="12"> </el-form-item>
<el-form-item </el-col>
label="工单号" <el-col :span="8">
prop="workOrderId"> <el-form-item label="数量" prop="num">
<el-select <el-input v-model="dataForm.num" placeholder="请输入数量" />
filterable </el-form-item>
v-model="dataForm.workOrderId" </el-col>
placeholder="请选择工单号" <el-col :span="8">
style="width: 100%"> <el-form-item label="报废时间" prop="logTime">
<el-option <el-date-picker style="width: 100%;" v-model="dataForm.logTime" type="datetime" value-format="timestamp"
v-for="dict in workOrderList" placeholder="选择日期">
:key="dict.id" </el-date-picker>
:label="dict.name" </el-form-item>
:value="dict.id" /> </el-col>
</el-select> </el-row>
</el-form-item> <el-row :gutter="20">
</el-col> <el-col :span="8">
<el-col :span="12"> <el-form-item label="产线" prop="lineId">
<el-form-item <el-select v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
label="数量" <el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
prop="num" </el-select>
style="width: 100%"> </el-form-item>
<el-input </el-col>
v-model="dataForm.num" <el-col :span="8">
placeholder="请输入数量" /> <el-form-item label="工段" prop="sectionId">
</el-form-item> <el-select v-model="dataForm.sectionId" placeholder="请选择工段">
</el-col> <el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-row> </el-select>
<el-row :gutter="20"> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item <el-col :span="8">
label="产线" <el-form-item label="报废原因" prop="detId">
prop="lineId"> <el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple>
<el-select <el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
v-model="dataForm.lineId" </el-select>
placeholder="请选择产线" </el-form-item>
@change="getWorksectionById" </el-col>
style="width: 100%"> </el-row>
<el-option <el-row :gutter="20">
v-for="dict in lineList" <el-col :span="24">
:key="dict.id" <el-form-item label="描述" prop="description">
:label="dict.name" <el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
:value="dict.id" /> </el-form-item>
</el-select> </el-col>
</el-form-item> </el-row>
</el-col> <el-col :span="8">
<el-col :span="12"> <el-form-item label="来源" prop="source">
<el-form-item <el-select v-model="dataForm.source" placeholder="请选择来源" multiple>
label="工段" <el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
prop="sectionId"> </el-select>
<el-select </el-form-item>
v-model="dataForm.sectionId" </el-col>
placeholder="请选择工段" <el-col :span="8">
style="width: 100%"> <el-form-item label="备注" prop="remark">
<el-option <el-input v-model="dataForm.remark" placeholder="备注" />
v-for="dict in sectionList" </el-form-item>
:key="dict.id" </el-col>
:label="dict.name" </el-form>
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报废时间"
prop="logTime">
<el-date-picker
style="width: 100%"
v-model="dataForm.logTime"
type="datetime"
value-format="timestamp"
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报废原因"
prop="detId">
<el-select
v-model="dataForm.detId"
placeholder="请选择报废原因"
multiple
style="width: 100%">
<el-option
v-for="dict in detList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item
label="描述"
prop="description">
<el-input
v-model="dataForm.description"
type="textarea"
:rows="4"
placeholder="请输入描述"
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-col :span="24">
<el-form-item
label="备注"
prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="备注"
style="width: 100%" />
</el-form-item>
</el-col>
</el-form>
</template> </template>
<script> <script>
import basicAdd from './basic-add'; import basicAdd from './basic-add';
import { import {
createQualityScrapLog, createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
updateQualityScrapLog, getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
getQualityScrapLog, import { getList,} from "@/api/base/qualityScrapType";
getWorkOrderList,
getTeamList,
getDetList,
getLineList,
} from '@/api/base/qualityScrapLog';
import { getList } from '@/api/base/qualityScrapType';
// import { getMaterialList } from "@/api/base/material"; // import { getMaterialList } from "@/api/base/material";
import moment from 'moment'; import moment from 'moment';
export default { export default {
@ -151,149 +86,154 @@ export default {
data() { data() {
return { return {
urlOptions: { urlOptions: {
isGetCode: false, isGetCode: false,
// codeURL: getCode, // codeURL: getCode,
createURL: createQualityScrapLog, createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog, updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog, infoURL: getQualityScrapLog,
}, },
lineList: [], lineList:[],
typeList: [], typeList: [],
workOrderList: [], workOrderList: [],
detList: [], detList:[],
teamList: [], teamList: [],
sectionList: [], sectionList:[],
sourceList: [
{
id: 1,
name: '平板端',
},
{
id: 2,
name: '网页端',
}
],
dataForm: { dataForm: {
id: undefined, id: undefined,
logTime: undefined, logTime: undefined,
detId: undefined, source:1,
workOrderId: null, detId: undefined,
teamId: undefined, workOrderId: null,
num: undefined, teamId: undefined,
sectionId: undefined, num: undefined,
lineId: undefined, sectionId:undefined,
description: undefined, lineId:undefined,
// description: undefined, description:undefined,
remark: undefined, // description: undefined,
remark: undefined,
}, },
// materialList: [], // materialList: [],
dataRule: { dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }], // materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [ workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
{ required: true, message: '工单号不能为空', trigger: 'change' }, num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
], detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
detId: [
{ required: true, message: '报废原因不能为空', trigger: 'change' },
],
logTime: [ logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
{ required: true, message: '报废时间不能为空', trigger: 'change' }, }
],
},
}; };
}, },
mounted() { mounted() {
this.getDict(); this.getDict()
console.log('我看看', this.dataForm); console.log('我看看', this.dataForm)
// this.getCurrentTime() // this.getCurrentTime()
// this.dataForm.logTime = new Date() // this.dataForm.logTime = new Date()
}, },
methods: { methods: {
// getCurrentTime() { // getCurrentTime() {
// // new Date().Format("yyyy-MM-dd HH:mm:ss") // // new Date().Format("yyyy-MM-dd HH:mm:ss")
// // this.dataForm.logTime = year + "-" + month + "-" + day; // // this.dataForm.logTime = year + "-" + month + "-" + day;
// // console.log(this.dataForm.logTime); // // console.log(this.dataForm.logTime);
// }, // },
async getDict() { async getDict() {
// //
const res = await getList(); const res = await getList()
this.typeList = res.data; this.typeList = res.data
getWorkOrderList().then((res) => { getWorkOrderList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
this.workOrderList = res.data.map((item) => { this.workOrderList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id
}; }
}); })
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); })
getLineList().then((res) => { getLineList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
this.lineList = res.data.map((item) => { this.lineList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id
}; }
}); })
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); })
getDetList().then((res) => { getDetList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
this.detList = res.data.map((item) => { this.detList = res.data.map((item) => {
return { return {
name: item.content, name: item.content,
id: item.id, id: item.id
}; }
}); })
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); })
getTeamList().then((res) => { getTeamList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
this.teamList = res.data.map((item) => { this.teamList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id
}; }
}); })
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); })
}, },
async getWorksectionById(lineId) { async getWorksectionById(lineId) {
if (lineId) { if (lineId) {
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/base/core-workshop-section/listByParentId', url: '/base/core-workshop-section/listByParentId',
method: 'get', method: 'get',
params: { params: {
id: lineId, id: lineId,
}, },
}); });
if (code == 0) { if (code == 0) {
console.log(data); console.log(data)
this.sectionList = data.map((item) => { this.sectionList = data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id,
}; };
}); });
} }
} else { } else {
this.$axios({ this.$axios({
url: '/base/core-workshop-section/listAll', url: '/base/core-workshop-section/listAll',
method: 'get', method: 'get',
// params: { // params: {
// id: lineId, // id: lineId,
// }, // },
}).then((res) => { }).then((res) => {
// console.log(data) // console.log(data)
this.sectionList = res.data.map((item) => { this.sectionList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id,
}; };
}); });
}); })
} }
}, },
// setMaterialCode() { // setMaterialCode() {
// const chooseM = this.materialList.filter(item => { // const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId // return item.id === this.dataForm.materialId

View File

@ -58,6 +58,10 @@ export default {
this.dataForm.detId = response.data.detIdList this.dataForm.detId = response.data.detIdList
this.getWorksectionById(this.dataForm.lineId) this.getWorksectionById(this.dataForm.lineId)
this.dataForm.logTime = new Date(response.data.logTime) this.dataForm.logTime = new Date(response.data.logTime)
// if (this.setData) {
// this.setDataForm()
// }
}); });
} else { } else {
if (this.urlOptions.isGetCode) { if (this.urlOptions.isGetCode) {

View File

@ -24,7 +24,7 @@ export default {
}, },
tableData: [], tableData: [],
listQuery: { listQuery: {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}, },

View File

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

View File

@ -1,45 +1,19 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
ref="searchBarForm" :limit="listQuery.pageSize" :table-data="tableData">
@headBtnClick="buttonClick" /> <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
<base-table @clickBtn="handleClick" />
:max-height="tableH" </base-table>
v-loading="dataListLoading" <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
:table-props="tableProps" @pagination="getDataList" />
:page="listQuery.pageNo" <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
:limit="listQuery.pageSize" @confirm="handleConfirm" :before-close="handleCancel" width="50%">
:table-data="tableData"> <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
<method-btn </base-dialog>
v-if="tableBtn.length" <detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
slot="handleBtn" </div>
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
<detail-or-update
v-if="detailOrUpdateVisible"
ref="detailOrUpdate"
@refreshDataList="successSubmit" />
</div>
</template> </template>
<script> <script>
@ -49,211 +23,201 @@ import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import basicPage from './basic-page'; import basicPage from './basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getQualityScrapLogPage, getQualityScrapLogPage,
deleteQualityScrapLog, deleteQualityScrapLog,
getWorkOrderList, getWorkOrderList,
// getTeamList // getTeamList
} from '@/api/base/qualityScrapLog'; } from '@/api/base/qualityScrapLog';
const tableProps = [ const tableProps = [
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'createTime',
label: '报废时间',
filter: parseTime
},
{
prop: 'lineName',
label: '产线名称'
},
{
prop: 'sectionName',
label: '工段'
},
{
prop: 'workOrderName',
label: '工单名称'
},
{
prop: 'num',
label: '数量'
},
{ {
prop: 'createTime', prop: 'detContent',
label: '报废时间', label: '报废原因'
filter: parseTime, },
width: 160, {
}, prop: 'source',
{ label: '来源',
prop: 'lineName', filter: (val) => val == 1 ? '平板端' : '网页端'
label: '产线名称', },
width: 90,
},
{
prop: 'sectionName',
label: '工段',
minWidth: 100,
},
{
prop: 'workOrderName',
label: '工单名称',
minWidth: 160,
},
{
prop: 'num',
label: '数量',
width: 90,
},
{
prop: 'detContent',
label: '报废原因',
minWidth: 160,
},
{
prop: 'source',
label: '来源',
filter: (val) => (val == 1 ? '平板端' : '网页端'),
width: 90,
},
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage, tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getQualityScrapLogPage, getDataListURL: getQualityScrapLogPage,
deleteURL: deleteQualityScrapLog, deleteURL: deleteQualityScrapLog,
// exportURL: exportFactoryExcel, // exportURL: exportFactoryExcel,
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:quality-scrap-log:update`) this.$auth.hasPermi(`base:quality-scrap-log:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:quality-scrap-log:detail`) this.$auth.hasPermi(`base:quality-scrap-log:detail`)
? { ? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:quality-scrap-log:delete`) this.$auth.hasPermi(`base:quality-scrap-log:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v)=>v),
tableData: [], tableData: [],
detailOrUpdateVisible: false, detailOrUpdateVisible:false,
formConfig: [ formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
filterable: true
},
// {
// type: 'select',
// label: '',
// selectOptions: [],
// labelField: 'name',
// valueField: 'id',
// param: 'teamId',
// filterable: true
// },
{ {
type: 'select', type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
label: '工单',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId',
filterable: true,
},
// {
// type: 'select',
// label: '',
// selectOptions: [],
// labelField: 'name',
// valueField: 'id',
// param: 'teamId',
// filterable: true
// },
{
type: this.$auth.hasPermi('base:quality-scrap-det:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'separate' : '',
? 'separate'
: '',
// type: 'separate', // type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:create') type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true
}, },
], ],
}; };
}, },
components: { components: {
AddOrUpdate, AddOrUpdate,
DetailOrUpdate, DetailOrUpdate
}, },
mounted() { mounted() {
this.getDict(); this.getDict()
this.getDataList(); this.getDataList()
}, },
methods: { methods: {
otherMethods(val) { otherMethods(val) {
if (val.type === 'detail') { if (val.type === 'detail') {
this.detailOrUpdateVisible = true; this.detailOrUpdateVisible = true;
// this.addOrEditTitle = ""; // this.addOrEditTitle = "";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id, true); this.$refs.detailOrUpdate.init(val.data.id, true);
}); });
} }
}, },
deleteHandle(id, name, index, data) { deleteHandle(id, name, index, data) {
this.$confirm(`确认要删除序号为${index}的数据项?`, '提示', { this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
}) })
.then(() => { .then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => { this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({ this.$message({
message: '操作成功', message: "操作成功",
type: 'success', type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList();
}, },
}); });
}); });
}) })
.catch(() => {}); .catch(() => { });
}, },
// //
getDict() { getDict() {
getWorkOrderList().then((res) => { getWorkOrderList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
this.formConfig[0].selectOptions = res.data.map((item) => { this.formConfig[0].selectOptions = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id
}; }
}); })
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); })
// getTeamList().then((res) => { // getTeamList().then((res) => {
// console.log(res); // console.log(res);
// // console.log(response); // // console.log(response);
// this.formConfig[1].selectOptions = res.data.map((item) => { // this.formConfig[1].selectOptions = res.data.map((item) => {
// return { // return {
// name: item.name, // name: item.name,
// id: item.id // id: item.id
// } // }
// }) // })
// // console.log(this.formConfig[0].selectOptions); // // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total; // // this.listQuery.total = response.data.total;
// }) // })
}, },
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => { this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 20;
this.listQuery.workOrderId = val.workOrderId this.listQuery.workOrderId = val.workOrderId ? val.workOrderId : undefined;
? val.workOrderId // this.listQuery.teamId = val.teamId ? val.teamId : undefined;
: undefined;
// this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':
@ -263,7 +227,7 @@ export default {
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };
this.getDataList(); this.getDataList()
break; break;
case 'add': case 'add':
this.addOrEditTitle = '新增'; this.addOrEditTitle = '新增';

View File

@ -1,52 +1,26 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar :isFold="true" :formConfigs="searchBarFormConfig" ref="search-bar"
:isFold="true" @headBtnClick="handleSearchBarBtnClick" />
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" @emitFun="handleEmitFun">
:page="queryParams.pageNo" <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
:limit="queryParams.pageSize" @clickBtn="handleTableBtnClick" />
:table-data="list" </base-table>
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="90"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog <base-dialog :dialogTitle="title" :dialogVisible="open" width="50%" @close="cancel" @cancel="cancel"
:dialogTitle="title" @confirm="submitForm">
:dialogVisible="open" <DialogForm v-if="open" ref="form" v-model="form" />
width="50%" </base-dialog>
@close="cancel" </div>
@cancel="cancel"
@confirm="submitForm">
<DialogForm
v-if="open"
ref="form"
v-model="form" />
</base-dialog>
</div>
</template> </template>
<script> <script>
@ -63,34 +37,27 @@ import moment from 'moment';
import DialogForm from './dialogForm.vue'; import DialogForm from './dialogForm.vue';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'QualityInspectionRecord', name: 'QualityInspectionRecord',
components: { components: {
DialogForm, DialogForm,
}, },
mixins: [basicPageMixin, tableHeightMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
rows: [ rows: [
[ [
{ {
select: true, select: true,
label: '工单名称', label: '工单名称',
url: 'base/core-work-order/listbyfilter', url: 'base/core-work-order/listbyfilter',
prop: 'workOrderId', prop: 'workOrderId',
rules: [ rules: [{ required: true, message: '工单名称不能为空', trigger: 'change' }],
{ bind: {
required: true, filterable: true,
message: '工单名称不能为空', },
trigger: 'change', }
}, ],
],
bind: {
filterable: true,
},
},
],
[ [
{ {
select: true, select: true,
@ -98,9 +65,7 @@ export default {
url: '/base/quality-inspection-det/listAll', url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId', prop: 'inspectionDetId',
labelKey: 'content', labelKey: 'content',
rules: [ rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
{ required: true, message: '检测内容不能为空', trigger: 'blur' },
],
bind: { bind: {
filterable: true, filterable: true,
}, },
@ -128,9 +93,7 @@ export default {
bind: { bind: {
filterable: true, filterable: true,
}, },
rules: [ rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
{ required: true, message: '产线不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
@ -150,6 +113,7 @@ export default {
label: '检测人员', label: '检测人员',
prop: 'checkPerson', prop: 'checkPerson',
}, },
], ],
[{ textarea: true, label: '描述', prop: 'explainText' }], [{ textarea: true, label: '描述', prop: 'explainText' }],
[{ input: true, label: '备注', prop: 'remark' }], [{ input: true, label: '备注', prop: 'remark' }],
@ -157,32 +121,32 @@ export default {
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'select', type: 'select',
label: '工单名称', label: '工单名称',
placeholder: '请选择工单名称', placeholder: '请选择工单名称',
param: 'workOrderId', param: 'workOrderId',
selectOptions: [], selectOptions: [],
filterable: true, filterable:true
}, },
{ {
type: 'select', type: 'select',
label: '检测内容', label: '检测内容',
placeholder: '请输入检测内容', placeholder: '请输入检测内容',
selectOptions: [], selectOptions: [],
param: 'inspectionDetContent', param: 'inspectionDetContent',
filterable: true, filterable: true
}, },
{ {
type: 'select', type: 'select',
label: '检测人员', label: '检测人员',
placeholder: '请选择检测人员', placeholder: '请选择检测人员',
selectOptions: [], selectOptions: [],
param: 'checkPerson', param: 'checkPerson',
filterable: true, filterable: true,
multiple: true, multiple:true,
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '检测时间', label: '时间',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
@ -195,21 +159,27 @@ export default {
// width: 350, // width: 350,
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-record:query') type: this.$auth.hasPermi(
? 'button' 'base:quality-inspection-record:query'
: '', )
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-record:create') type: this.$auth.hasPermi(
? 'separate' 'base:quality-inspection-record:create'
: '', )
? 'separate'
: '',
// type: 'separate', // type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-record:create') type: this.$auth.hasPermi(
'base:quality-inspection-record:create'
)
? 'button' ? 'button'
: '', : '',
btnName: '新增', btnName: '新增',
@ -225,7 +195,7 @@ export default {
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:quality-inspection-record:delete') this.$auth.hasPermi('base:quality-inspection-record:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@ -237,66 +207,64 @@ export default {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 160, width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ {
prop: 'workOrderName', // width: 128,
label: '工单名称', prop: 'workOrderName',
minWidth: 180, label: '工单名称',
showOverflowtooltip: true, },
}, {
// width: 128,
prop: 'productionLineName',
label: '产线',
},
{
// width: 128,
prop: 'sectionName',
label: '工段',
},
{ {
// width: 128,
prop: 'inspectionDetContent', prop: 'inspectionDetContent',
label: '检测内容', label: '检测内容',
minWidth: 180,
showOverflowtooltip: true,
},
{
prop: 'productionLineName',
label: '产线',
minWidth: 80,
},
{
prop: 'sectionName',
label: '工段',
minWidth: 120,
}, },
// {
// // width: 128,
// prop: 'productionLineName',
// label: '线',
// },
{ {
// width: 128,
prop: 'checkPerson', prop: 'checkPerson',
label: '检测人员', label: '检测人员',
showOverflowtooltip: true,
}, },
{ {
// width: 160,
prop: 'checkTime', prop: 'checkTime',
label: '检测时间', label: '检测时间',
width: 160,
filter: (val) => filter: (val) =>
val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-', val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
}, },
{ {
width: 90,
prop: 'source', prop: 'source',
label: '来源', label: '来源',
width: 80, filter: (val) => val == 1 ? '平板端' : '网页端',
filter: (val) => (val == 1 ? '平板端' : '网页端'),
}, },
], ],
// keys, queryParams pageNo, pageSize key // keys, queryParams pageNo, pageSize key
searchBarKeys: [ searchBarKeys: ['inspectionDetContent', 'checkTime', 'workOrderId','checkPerson'],
'inspectionDetContent',
'checkTime',
'workOrderId',
'checkPerson',
],
form: { form: {
id: undefined, id: undefined,
// workOrderId:undefined, // workOrderId:undefined,
inspectionDetId: undefined, inspectionDetId: undefined,
inspectionDetContent: undefined, inspectionDetContent: undefined,
productionLineId: undefined, productionLineId: undefined,
sectionId: undefined, sectionId: undefined,
checkPerson: undefined, checkPerson: undefined,
workOrderId: undefined, workOrderId:undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: undefined,
explainText: undefined, explainText: undefined,
@ -305,26 +273,26 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 10,
workOrderId: null, workOrderId:null,
inspectionDetContent: null, inspectionDetContent: null,
checkTime: [], checkTime: [],
checkPerson: undefined, checkPerson:undefined,
// productionLineId: null, // productionLineId: null,
}, },
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getProductLineList(); this.getProductLineList()
}, },
watch: { watch: {
form: { form: {
handler: function (val) { handler: function (val) {
console.log('form change:', val); console.log('form change:', val);
}, },
deep: true, deep: true
}, }
// 线 // 线
// 'form.productionLineId': { // 'form.productionLineId': {
// handler: function (val) { // handler: function (val) {
@ -350,29 +318,29 @@ export default {
// }, // },
}, },
methods: { methods: {
/** 获取搜索栏的产线列表 */ /** 获取搜索栏的产线列表 */
deleteHandle(id, name, index, data) { deleteHandle(id, name, index, data) {
this.$confirm(`确认要删除序号为${index}的数据项?`, '提示', { this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
}) })
.then(() => { .then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => { this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({ this.$message({
message: '操作成功', message: "操作成功",
type: 'success', type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList();
}, },
}); });
}); });
}) })
.catch(() => {}); .catch(() => { });
}, },
getProductLineList() { getProductLineList() {
this.$axios('/base/core-work-order/listbyfilter').then((response) => { this.$axios('/base/core-work-order/listbyfilter').then((response) => {
this.searchBarFormConfig[0].selectOptions = response.data.map( this.searchBarFormConfig[0].selectOptions = response.data.map(
(item) => { (item) => {
return { return {
@ -381,36 +349,34 @@ export default {
}; };
} }
); );
}); })
this.$axios('/base/quality-inspection-det/listAll').then((response) => { this.$axios('/base/quality-inspection-det/listAll').then((response) => {
this.searchBarFormConfig[1].selectOptions = response.data.map( this.searchBarFormConfig[1].selectOptions = response.data.map(
(item) => { (item) => {
return { return {
name: item.content, name: item.content,
id: item.content, id: item.content,
}; };
} }
); );
}); })
this.$axios('base/quality-inspection-box-btn-auth/getUserList', { this.$axios('base/quality-inspection-box-btn-auth/getUserList', {
pageNo: 1, pageNo: 1,
pageSize: 999, pageSize: 999
}).then((res) => { }).then((res) => {
// console.log(response); // console.log(response);
this.searchBarFormConfig[2].selectOptions = res.data.map((item) => ({ this.searchBarFormConfig[2].selectOptions = res.data.map((item) => ({
name: item.username, name: item.username,
id: item.username, id: item.username,
})); }));
}); })
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
// //
let str = this.queryParams.checkPerson let str = this.queryParams.checkPerson ? this.queryParams.checkPerson.join() :undefined
? this.queryParams.checkPerson.join() this.queryParams.checkPerson = str
: undefined;
this.queryParams.checkPerson = str;
getQualityInspectionRecordPage(this.queryParams).then((response) => { getQualityInspectionRecordPage(this.queryParams).then((response) => {
this.list = response.data.list; this.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
@ -430,8 +396,8 @@ export default {
inspectionDetContent: undefined, inspectionDetContent: undefined,
sectionId: undefined, sectionId: undefined,
checkPerson: undefined, checkPerson: undefined,
checkTime: undefined, checkTime: undefined,
workOrderId: undefined, workOrderId:undefined,
source: undefined, source: undefined,
explainText: undefined, explainText: undefined,
remark: undefined, remark: undefined,
@ -460,14 +426,14 @@ export default {
this.reset(); this.reset();
const id = row.id; const id = row.id;
getQualityInspectionRecord(id).then((response) => { getQualityInspectionRecord(id).then((response) => {
/** 因为后端返回的时间是时间戳格式,需转换 */ /** 因为后端返回的时间是时间戳格式,需转换 */
console.log(response.data); console.log(response.data);
const info = {}; const info = {}
Object.keys(this.form).forEach((key) => { Object.keys(this.form).forEach(key => {
info[key] = response.data[key]; info[key] = response.data[key]
}); });
this.form = info; this.form = info;
console.log(this.form); console.log(this.form);
this.open = true; this.open = true;
this.title = '修改质量检查信息记录表'; this.title = '修改质量检查信息记录表';
}); });
@ -478,9 +444,9 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
// //
let str = this.form.checkPerson ? this.form.checkPerson.join() : null; let str = this.form.checkPerson ? this.form.checkPerson.join() : null
this.form.checkPerson = str; this.form.checkPerson = str
if (this.form.id != null) { if (this.form.id != null) {
updateQualityInspectionRecord(this.form).then((response) => { updateQualityInspectionRecord(this.form).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');

View File

@ -68,7 +68,6 @@ export default {
label: '生产线', label: '生产线',
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
multiple: true,
}, },
{ {
type: 'select', type: 'select',
@ -105,7 +104,6 @@ export default {
label: '生产线', label: '生产线',
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
multiple: true,
}, },
{ {
type: 'select', type: 'select',
@ -139,12 +137,12 @@ export default {
queryParams: { queryParams: {
startTime: '', startTime: '',
endTime: '', endTime: '',
lineId: [], lineId: '',
}, },
queryParams2: { queryParams2: {
startTime: '', startTime: '',
endTime: '', endTime: '',
lineId: [], lineId: '',
}, },
tableProp1, tableProp1,
tableProp: [], tableProp: [],
@ -152,11 +150,11 @@ export default {
tableProp2: [], tableProp2: [],
tableData2: [], tableData2: [],
procedureName: [ procedureName: [
// { name: '(t)', ename: 'calenderingCapacity' }, { name: '压延(拉引量t)', ename: 'calenderingCapacity' },
{ name: '优化切割(片)', ename: 'cuttingNum' }, { name: '优化切割(片)', ename: 'cuttingNum' },
{ name: '堆垛(片)', ename: 'unloadPieces' }, { name: '堆垛(片)', ename: 'unloadPieces' },
{ name: '堆垛(托)', ename: 'unloadCount' }, { name: '堆垛(托)', ename: 'unloadCount' },
{ name: '优切良品率(%)', ename: 'rate' }, { name: '良品率(%)', ename: 'rate' },
], ],
span: [], //2 span: [], //2
}; };
@ -313,10 +311,10 @@ export default {
} else { } else {
if (data[i].lineName === data[i - 1].lineName) { if (data[i].lineName === data[i - 1].lineName) {
//线, //线,
let startNum = 4 * (lineNum - 1); let startNum = 5 * (lineNum - 1);
let endNum = 4 * lineNum - 1; let endNum = 5 * lineNum - 1;
for (let k = startNum; k <= endNum; k++) { for (let k = startNum; k <= endNum; k++) {
let str = this.procedureName[k % 4]; let str = this.procedureName[k % 5];
tempData[k][data[i].timeStr] = data[i][str.ename]; tempData[k][data[i].timeStr] = data[i][str.ename];
} }
} else { } else {
@ -358,9 +356,9 @@ export default {
// //
objectSpanMethod({ row, column, rowIndex, columnIndex }) { objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) { if (columnIndex === 0) {
if (rowIndex % 4 === 0) { if (rowIndex % 5 === 0) {
return { return {
rowspan: 4, rowspan: 5,
colspan: 1, colspan: 1,
}; };
} else { } else {
@ -382,17 +380,9 @@ export default {
obj.lineName = data[i].lineName; obj.lineName = data[i].lineName;
obj.procedure = data[i].productDet[j].name; obj.procedure = data[i].productDet[j].name;
data[i].productDet[j].data.map((item) => { data[i].productDet[j].data.map((item) => {
obj[item.timeStr] = item.output obj[item.timeStr] = item.input || null;
? item.output
: item.input
? item.input
: null;
}); });
obj.sum = data[i].productDet[j].allOutput obj.sum = data[i].productDet[j].allInput;
? data[i].productDet[j].allOutput
: data[i].productDet[j].allInput
? data[i].productDet[j].allInput
: null;
this.tableData2.push(obj); this.tableData2.push(obj);
} }
} }
@ -482,7 +472,7 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
background-color: #ebeef5; background-color: #ebeef5;
transform: rotate(-63deg); transform: rotate(-70deg);
-webkit-transform-origin: top; -webkit-transform-origin: top;
transform-origin: top; transform-origin: top;
width: 1px; width: 1px;
@ -490,11 +480,11 @@ export default {
.el-table thead.is-group tr:last-of-type th:nth-child(1):before { .el-table thead.is-group tr:last-of-type th:nth-child(1):before {
content: ''; content: '';
position: absolute; position: absolute;
height: 93px; height: 67px;
top: 0; top: 0;
left: 55px; left: 75px;
background-color: #ebeef5; background-color: #ebeef5;
transform: rotate(-63deg); transform: rotate(-70deg);
-webkit-transform-origin: top; -webkit-transform-origin: top;
transform-origin: top; transform-origin: top;
width: 1px; width: 1px;

View File

@ -3,8 +3,7 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
@headBtnClick="buttonClick" @headBtnClick="buttonClick" />
@datepicker-change="datepickerChange" />
<base-table <base-table
class="israLineReportTable1" class="israLineReportTable1"
ref="israLineReportTable11" ref="israLineReportTable11"
@ -58,16 +57,14 @@ export default {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 300, width: 250,
onchange: true,
clearable: false,
}, },
{ {
type: 'select', type: 'select',
@ -109,14 +106,12 @@ export default {
}, },
mounted() { mounted() {
this.tableProp = this.tableProp1; this.tableProp = this.tableProp1;
let start = moment(moment().format('yyyy-MM-DD') + ' 07:00:00').format( let start = moment().format('yyyy-MM-DD');
'yyyy-MM-DD HH:mm:ss' let end = moment().format('yyyy-MM-DD');
);
let end =
moment(moment().valueOf() + 86400000).format('yyyy-MM-DD') + ' 06:59:59';
this.formConfig[0].defaultSelect = [start, end]; this.formConfig[0].defaultSelect = [start, end];
this.queryParams.startTime = moment(start).valueOf(); this.queryParams.startTime =
this.queryParams.endTime = moment(end).valueOf(); moment(start + ' 00:00:00').valueOf() + 25200000;
this.queryParams.endTime = moment(end + ' 23:59:59').valueOf() + 25200000;
this.getList(); this.getList();
}, },
methods: { methods: {
@ -242,22 +237,13 @@ export default {
} }
} }
}, },
// change
datepickerChange(val) {
console.log(val);
let start = moment(
moment(val.value[0]).format('yyyy-MM-DD') + ' 07:00:00'
).format('yyyy-MM-DD HH:mm:ss');
let end =
moment(moment(val.value[1]).valueOf() + 86400000).format('yyyy-MM-DD') +
' 06:59:59';
this.formConfig[0].defaultSelect = [start, end];
},
buttonClick(val) { buttonClick(val) {
if (val.btnName === 'search') { if (val.btnName === 'search') {
if (val.timeVal && val.timeVal.length > 0) { if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.startTime = moment(val.timeVal[0]).valueOf(); this.queryParams.startTime =
this.queryParams.endTime = moment(val.timeVal[1]).valueOf(); moment(val.timeVal[0] + ' 00:00:00').valueOf() + 25200000;
this.queryParams.endTime =
moment(val.timeVal[1] + ' 23:59:59').valueOf() + 25200000;
} }
this.queryParams.lineId = val.lineId; this.queryParams.lineId = val.lineId;
this.getList(); this.getList();