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
7 changed files with 320 additions and 137 deletions

View File

@ -1,12 +1,13 @@
<!-- <!--
* @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>
@ -44,6 +45,12 @@
</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="packagingBarCode">
<el-input v-model="dataForm.packagingBarCode" clearable placeholder="请输入包装条码" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="标签模板" prop="modelId"> <el-form-item label="标签模板" prop="modelId">
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable> <el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable>
@ -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,6 +55,10 @@ const tableProps = [
{ {
prop: 'packagingCode', prop: 'packagingCode',
label: '包装流水号' label: '包装流水号'
},
{
prop: 'packagingBarCode',
label: '包装条码'
}, },
{ {
prop: 'workOrderName', prop: 'workOrderName',

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,6 +192,42 @@ 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 => {

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,15 +201,45 @@ 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,
};
});
}
} }
}, },
}; };

View File

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

View File

@ -286,6 +286,7 @@ export default {
// this.searchBarFormConfig[0].defaultSelect = []; // this.searchBarFormConfig[0].defaultSelect = [];
// } // }
this.getList() this.getList()
this.getDict()
}, },
methods: { methods: {
/** 获取搜索栏的产线列表 */ /** 获取搜索栏的产线列表 */
@ -320,7 +321,7 @@ export default {
// }, // },
getList() { getList() {
this.getDataList() this.getDataList()
this.getDict() // this.getDict()
}, },
/** 查询列表 */ /** 查询列表 */
async getDataList() { async getDataList() {
@ -330,7 +331,7 @@ export default {
const { const {
data: { data, otherList, otherMap, nameData }, data: { data, otherList, otherMap, nameData },
} = await getStatisticalDataPage(this.queryParams) } = await getStatisticalDataPage(this.queryParams)
console.log(this.queryParams); // console.log(this.queryParams);
this.dynamicProps = this.filterNameData(nameData) this.dynamicProps = this.filterNameData(nameData)
this.list = this.filterData(data); this.list = this.filterData(data);
}, },
@ -373,7 +374,7 @@ export default {
this.getList() this.getList()
} }
console.log(val); // console.log(val);
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
// handleQuery() { // handleQuery() {