projects/mesxc-zhp #215

Merged
juzi merged 4 commits from projects/mesxc-zhp into projects/mesxc-test 2024-02-28 11:23:36 +08:00
6 changed files with 316 additions and 134 deletions
Showing only changes of commit afd6e68d9b - Show all commits

View File

@ -1,72 +1,79 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-10-17 16:50:19 * @Date: 2023-10-17 16:50:19
* @LastEditTime: 2023-12-01 16:48:53 * @LastEditTime: 2024-02-28 10:07:29
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true"> <el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%"
show-close="true">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ !dataForm.id ? '新增' : '编辑' }} {{ !dataForm.id ? '新增' : '编辑' }}
</small-title> </small-title>
<!-- <!--
<div class="content"> <div class="content">
<div class="visual-part"> --> <div class="visual-part"> -->
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit"> @keyup.enter.native="dataFormSubmit">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="包装流水号" prop="packagingCode"> <el-form-item label="包装流水号" prop="packagingCode">
<el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" /> <el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="内容" prop="content"> <el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" clearable placeholder="请输入内容" /> <el-input v-model="dataForm.content" clearable placeholder="请输入内容" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属工单" prop="workOrderId"> <el-form-item label="所属工单" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable> <el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable>
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户" prop="customerId"> <el-form-item label="客户" prop="customerId">
<el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable> <el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable>
<el-option v-for="dict in customerList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in customerList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="标签模板" prop="modelId"> <el-col :span="12">
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable> <el-form-item label="包装条码" prop="packagingBarCode">
<el-option v-for="dict in modelList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-input v-model="dataForm.packagingBarCode" clearable placeholder="请输入包装条码" />
</el-select> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
<!-- <el-col :span="12"> <el-form-item label="标签模板" prop="modelId">
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable>
<el-option v-for="dict in modelList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="单位平方数" prop="area"> <el-form-item label="单位平方数" prop="area">
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" /> <el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
</el-row> </el-row>
<!-- <el-row :gutter="20"> <!-- <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="完成单位产品用时" prop="processTime"> <el-form-item label="完成单位产品用时" prop="processTime">
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" /> <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> --> </el-row> -->
</el-form> </el-form>
<!-- <small-title <!-- <small-title
style="margin: 16px 0; padding-left: 8px" style="margin: 16px 0; padding-left: 8px"
:no-padding="true"> :no-padding="true">
产品属性列表 产品属性列表
@ -96,7 +103,7 @@
:page-sizes="[5, 10, 15]" :page-sizes="[5, 10, 15]"
@pagination="getList" /> @pagination="getList" />
</div> --> </div> -->
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->
<!-- <div style="position: absolute; bottom: 24px; right: 24px"> <!-- <div style="position: absolute; bottom: 24px; right: 24px">
@ -186,6 +193,7 @@ export default {
workOrderId: null, // (s) workOrderId: null, // (s)
customerId: '', // customerId: '', //
content: '', // id content: '', // id
packagingBarCode: null
}, },
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-24 09:13:50 * @LastEditTime: 2024-02-28 10:38:34
* @Description: * @Description:
--> -->
<template> <template>
@ -55,7 +55,11 @@ const tableProps = [
{ {
prop: 'packagingCode', prop: 'packagingCode',
label: '包装流水号' label: '包装流水号'
}, },
{
prop: 'packagingBarCode',
label: '包装条码'
},
{ {
prop: 'workOrderName', prop: 'workOrderName',
label: '所属工单' label: '所属工单'

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-02-18 14:07:08 * @LastEditTime: 2024-02-28 09:58:34
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -15,35 +15,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="班组" prop="teamId">
<el-select v-model="dataForm.teamId" placeholder="请选择班组">
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="数量" prop="num"> <el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="请输入数量" /> <el-input v-model="dataForm.num" placeholder="请输入数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线">
<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="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因">
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报废时间" prop="logTime"> <el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
@ -54,12 +30,28 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="来源" prop="source"> <el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.source" placeholder="请选择来源"> <el-select v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="工段" prop="sectionId">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段">
<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>
<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="8"> <el-col :span="8">
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" /> <el-input v-model="dataForm.description" placeholder="请输入描述" />
@ -76,7 +68,7 @@
</template> </template>
<script> <script>
import basicAdd from '../../../core/mixins/basic-add'; import basicAdd from './basic-add';
import { import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList, createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog"; getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
@ -99,6 +91,7 @@ export default {
workOrderList: [], workOrderList: [],
detList:[], detList:[],
teamList: [], teamList: [],
sectionList:[],
sourceList: [ sourceList: [
{ {
id: 1, id: 1,
@ -117,6 +110,7 @@ export default {
workOrderId: null, workOrderId: null,
teamId: undefined, teamId: undefined,
num: undefined, num: undefined,
sectionId:undefined,
lineId:undefined, lineId:undefined,
description:undefined, description:undefined,
// description: undefined, // description: undefined,
@ -137,6 +131,7 @@ export default {
this.getDict() this.getDict()
console.log('我看看', this.dataForm) console.log('我看看', this.dataForm)
this.getCurrentTime() this.getCurrentTime()
this.getWorksectionById()
}, },
methods: { methods: {
getCurrentTime() { getCurrentTime() {
@ -197,7 +192,43 @@ export default {
// 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) {
if (lineId) {
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,
};
});
}
} 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,
};
});
})
}
},
// 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

@ -0,0 +1,106 @@
/*
* @Author: zhp
* @Date: 2024-02-28 09:51:25
* @LastEditTime: 2024-02-28 10:05:00
* @LastEditors: zhp
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
createURL: '',
updateURL: '',
infoURL: '',
codeURL: '',
getOption: false,
isGetCode: false,
optionArrUrl: [],
optionArr: {}
},
visible: false,
setData: false
}
},
created() {
},
activated() {
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
console.log(response)
this.dataForm = response.data
this.dataForm.detId = response.data.detIdList
this.dataForm.logTime = new Date(response.data.createTime)
// if (this.setData) {
// this.setDataForm()
// }
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getArr() {
const params = {
pageSize: 100,
pageNo: 1,
}
this.urlOptions.optionArrUrl.forEach((item, index) => {
item(params).then(({ data: res }) => {
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
})
.catch(() => {
});
});
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
let str = this.dataForm.detId.join(',')
this.dataForm.detId = str
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
formClear() {
this.$refs.dataForm.resetFields()
}
}
}

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-12-01 10:58:25 * @LastEditTime: 2024-02-28 10:13:10
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -15,43 +15,19 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工单号" prop="workOrderId"> <el-form-item label="工单号" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号" disabled> <el-select disabled v-model="dataForm.workOrderId" placeholder="请选择工单号">
<el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="班组" prop="teamId"> <el-form-item label="数量" prop="num">
<el-select v-model="dataForm.teamId" placeholder="请选择班组" disabled> <el-input disabled v-model="dataForm.num" placeholder="请输入数量" />
<el-option v-for="dict in teamList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="数量" prop="sum">
<el-input v-model="dataForm.sum" placeholder="请输入数量" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.lineId" placeholder="请选择产线" disabled>
<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="detId">
<el-select v-model="dataForm.detId" placeholder="请选择报废原因" disabled>
<el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报废时间" prop="logTime"> <el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" disabled <el-date-picker disabled v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -59,12 +35,28 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="来源" prop="source"> <el-form-item label="产线" prop="lineId">
<el-select v-model="dataForm.source" placeholder="请选择来源" disabled> <el-select disabled v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
<el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<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" />
</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>
<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="8"> <el-col :span="8">
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" disabled /> <el-input v-model="dataForm.description" placeholder="请输入描述" disabled />
@ -147,6 +139,7 @@ export default {
this.getDict() this.getDict()
console.log('我看看', this.dataForm) console.log('我看看', this.dataForm)
this.getCurrentTime() this.getCurrentTime()
// this.getWorksectionById()
}, },
methods: { methods: {
// init() { // init() {
@ -198,6 +191,7 @@ export default {
// 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);
@ -207,16 +201,46 @@ export default {
id: item.id id: item.id
} }
}) })
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,
};
});
})
// if (code == 0) {
// }
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}) })
}, },
setMaterialCode() { async getWorksectionById(lineId) {
const chooseM = this.materialList.filter(item => { const { code, data } = await this.$axios({
return item.id === this.dataForm.materialId url: '/base/core-workshop-section/listByParentId',
}) method: 'get',
this.dataForm.materialCode = chooseM[0].code params: {
} id: lineId,
},
});
if (code == 0) {
console.log(data)
this.sectionList = data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
}
}
}, },
}; };
</script> </script>

View File

@ -30,32 +30,41 @@ import {
} from '@/api/base/qualityScrapLog'; } from '@/api/base/qualityScrapLog';
const tableProps = [ const tableProps = [
{ // {
prop: 'createTime', // prop: 'createTime',
label: '添加时间', // label: '',
filter: parseTime // filter: parseTime
// },
{
prop: 'logTime',
label: '报废时间',
filter: parseTime
},
{
prop: 'lineName',
label: '产线名称'
},
{
prop: 'sectionName',
label: '工段'
}, },
{ {
prop: 'workOrderName', prop: 'workOrderName',
label: '工单' label: '工单名称'
}, },
{ {
prop: 'teamName', prop: 'num',
label: '班组' label: '数量'
}, },
{ {
prop: 'detContent', prop: 'detContent',
label: '报废原因' label: '报废原因'
}, },
{ {
prop: 'logTime', prop: 'source',
label: '报废时间', label: '来源',
filter: parseTime filter: (val) => val == 1 ? '平板端' : '网页端'
}, },
{
prop: 'num',
label: '数量'
},
]; ];
export default { export default {