yudao-dev/src/views/quality/monitoring/originalGlassRetrace/index.vue

399 lines
12 KiB
Vue
Raw Normal View History

2023-12-13 16:50:55 +08:00
<!--
* @Author: zwq
* @Date: 2023-08-01 14:55:51
2024-04-25 14:43:29 +08:00
* @LastEditors: DY
* @LastEditTime: 2024-04-25 14:42:53
2023-12-13 16:50:55 +08:00
* @Description:
-->
<template>
<div class="app-container">
2024-04-25 14:43:29 +08:00
<!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
<el-form
:inline="true"
:model="listQuery"
class="blueTip">
<el-form-item label="合格证号" prop="certificateNumber">
<el-input size="small" v-model="listQuery.certificateNumber" clearable placeholder="合格证号" @blur="countTimes(1)" @clear="countArray[0] = false"></el-input>
</el-form-item>
<el-form-item label="成品周转编号" prop="packagingCode">
<el-input size="small" v-model="listQuery.packagingCode" clearable placeholder="成品周转编号" @blur="countTimes(2)" @clear="countArray[1] = false"></el-input>
</el-form-item>
<el-form-item label="原片周转编号" prop="glassCode">
<el-input size="small" v-model="listQuery.glassCode" clearable placeholder="原片周转编号" @blur="countTimes(3)" @clear="countArray[2] = false"></el-input>
</el-form-item>
<el-form-item label="包装全检时间及产线" prop="val">
<el-date-picker
v-model="listQuery.timeVal"
value-format="timestamp"
type="datetimerange"
size="small"
clearable
start-placeholder="包装全检开始时间"
end-placeholder="包装全检结束时间"
range-separator="-"
@change="countTimes('timestamp3')"
/>
<el-select v-model="listQuery.lineName" size="small" clearable filterable placeholder="产线" @change="countTimes('timestamp3')" style="margin-left: 5px">
<el-option label="区域一" value="shanghai"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
v-if="this.$auth.hasPermi('monitoring:rawMaterial-traceability:query')"
type="primary"
size="small"
@click="getList">
查询
</el-button>
</el-form-item>
</el-form>
<!-- <base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="list"> -->
<base-table :max-height="tableH" :table-props="tableProps"
2024-03-21 16:34:34 +08:00
:table-data="list">
2023-12-13 16:50:55 +08:00
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
2024-04-25 14:43:29 +08:00
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
@pagination="getList" /> -->
2023-12-13 16:50:55 +08:00
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template>
<script>
// import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict';
// import basicPage from '../mixins/basic-page';
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '../mixins/code-filter';
2024-03-29 16:56:21 +08:00
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
2023-12-13 16:50:55 +08:00
import {
getOriginalGlassRetrace,
getWorkOrderList,
// exportEnergyPlcExcel
} from '@/api/quality/rawMaterialTraceability';
const tableProps = [
{
2024-04-25 14:43:29 +08:00
prop: 'certificateNumber',
label: '合格证号',
2023-12-13 16:50:55 +08:00
},
{
2024-04-25 14:43:29 +08:00
prop: 'boxNumber',
label: '箱号',
2023-12-13 16:50:55 +08:00
},
{
prop: 'packagingCode',
2024-04-25 14:43:29 +08:00
label: '成品周转编号',
2023-12-13 16:50:55 +08:00
},
{
2024-02-23 16:02:55 +08:00
prop: 'deepProcessingLineName',
2023-12-13 16:50:55 +08:00
label: '深加工产线',
},
{
prop: 'deepProcessingInputTime',
label: '深加工上片时间',
filter: parseTime
},
{
2024-04-25 14:43:29 +08:00
prop: 'deepProcessingOutputTime',
2023-12-13 16:50:55 +08:00
label: '深加工下片时间',
filter: parseTime
2024-02-21 15:27:09 +08:00
},
2024-04-25 14:43:29 +08:00
{
prop: 'glassCode',
label: '原片周转编码',
},
{
prop: 'originalGlassLineName',
label: '原片产线',
},
{
prop: 'originalGlassOutputTime',
label: '原片下片时间',
filter: parseTime
},
2024-02-23 16:02:55 +08:00
// {
// prop: 'scrapDetail',
// label: '详情',
// filter: parseTime
// }
2023-12-13 16:50:55 +08:00
];
export default {
// mixins: [basicPage],
2024-03-29 16:56:21 +08:00
mixins: [tableHeightMixin],
2023-12-13 16:50:55 +08:00
data() {
return {
// urlOptions: {
// getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel,
// },
tableProps,
// tableBtn: [
2024-02-21 15:27:09 +08:00
// // this.$auth.hasPermi(`base:packaging-print-log:update`)
// // ?
// {
2023-12-13 16:50:55 +08:00
// type: 'edit',
// btnName: '编辑',
2024-02-21 15:27:09 +08:00
// },
// // : undefined,
// // this.$auth.hasPermi(`base:packaging-print-log:delete`)
// // ?
// {
2023-12-13 16:50:55 +08:00
// type: 'delete',
// btnName: '删除',
// }
2024-02-21 15:27:09 +08:00
// // : undefined,
2023-12-13 16:50:55 +08:00
// ].filter((v) => v),
list: [],
listQuery: {
2024-04-25 14:43:29 +08:00
// pageSize: 10,
// pageNo: 1,
// total: 0,
certificateNumber: undefined,
packagingCode: undefined,
timeVal:undefined,
lineName: undefined,
glassCode: undefined
2023-12-13 16:50:55 +08:00
},
2024-04-25 14:43:29 +08:00
count: 0,
useTime: false,
countArray: [],
2024-03-29 16:56:21 +08:00
// tableH: this.tableHeight(260),
2023-12-13 16:50:55 +08:00
formConfig: [
2024-04-25 14:43:29 +08:00
// {
// type: 'select',
// label: '工单',
// selectOptions: [],
// labelField: 'name',
// valueField: 'name',
// param: 'workOrderName',
// filterable: true
// },
{
type: 'input',
label: '合格证号',
placeholder: '合格证号',
param: 'certificateNumber',
},
{
type: 'input',
label: '成品周转编号',
placeholder: '成品周转编号',
param: 'packagingCode'
},
{
type: 'datePicker',
label: '包装全检时间及产线',
dateType: 'datetimerange',
format: 'timestamp',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
2023-12-13 16:50:55 +08:00
{
type: 'select',
2024-04-25 14:43:29 +08:00
label: '',
2023-12-13 16:50:55 +08:00
selectOptions: [],
labelField: 'name',
2024-03-01 15:27:01 +08:00
valueField: 'name',
2024-04-25 14:43:29 +08:00
param: 'lineName',
2024-03-21 16:34:34 +08:00
filterable: true
2023-12-13 16:50:55 +08:00
},
2024-04-25 14:43:29 +08:00
{
type: 'input',
label: '原片周转编号',
placeholder: '原片周转编号',
param: 'glassCode'
},
2023-12-13 16:50:55 +08:00
{
2024-04-08 13:55:22 +08:00
type: this.$auth.hasPermi('monitoring:rawMaterial-traceability:query') ? 'button' : '',
2023-12-13 16:50:55 +08:00
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '新增',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
2024-03-29 16:56:21 +08:00
// window.addEventListener('resize', () => {
// this.tableH = this.tableHeight(260)
// })
2024-04-25 14:43:29 +08:00
this.count = 0
this.useTime = false
// this.getList()
2023-12-13 16:50:55 +08:00
this.getDict()
},
methods: {
2024-04-25 14:43:29 +08:00
countTimes(val) {
if (val === 1) {
let temp = this.listQuery?.certificateNumber !== ''
this.countArray[0] = temp
console.log('你好', this.countArray)
}
if (val && val !== '') {
if (val === 'timestamp3') {
if (this.listQuery.timeVal.length > 0 || this.listQuery?.lineName !== '') {
this.useTime = true
} else {
this.useTime = false
}
} else {
this.count ++
}
} else {
this.count --
}
},
2023-12-13 16:50:55 +08:00
getList() {
2024-04-25 14:43:29 +08:00
// console.log('nihc ', this.count, this.listQuery)
// if (this.count > 1) {
// this.$message.error('请选择一个条件进行查询!')
// } else {
// if (this.useTime === true) {
// if (this.listQuery.timeVal.length > 0 && this.listQuery?.lineName !== '') {
// getOriginalGlassRetrace({ ...this.listQuery }).then(res => {
// console.log(res);
// this.list = res.data || []
// console.log(this.list);
// // this.listQuery.total = res.data.total || 0
// })
// } else {
// this.$message.error('选择包装全检时,时间和产线必填!')
// }
// } else {
2023-12-13 16:50:55 +08:00
getOriginalGlassRetrace({ ...this.listQuery }).then(res => {
console.log(res);
this.list = res.data || []
console.log(this.list);
// this.listQuery.total = res.data.total || 0
})
2024-04-25 14:43:29 +08:00
// }
// }
2023-12-13 16:50:55 +08:00
},
getDict() {
// 获取产品的属性列表
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
getWorkOrderList().then((response) => {
// console.log(response);
this.formConfig[0].selectOptions = response.data.map((item) => {
return {
name: item.name,
id: item.id
}
})
console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
})
},
// handleExport() {
// // 处理查询参数
// let params = { ...this.listQuery };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal.confirm('是否确认导出所有数据项?').then(() => {
// this.exportLoading = true;
// return exportEnergyPlcExcel(params);
// }).then(response => {
// this.$download.excel(response, '物料信息追溯 ');
// this.exportLoading = false;
// }).catch(() => { });
// },
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
2024-04-25 14:43:29 +08:00
this.listQuery.certificateNumber = val.certificateNumber ? val.certificateNumber :undefined
2023-12-13 16:50:55 +08:00
// this.queryParams.status = val.status
// if (val.timeVal && val.timeVal.length != 0 ) {
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
// } else {
// this.listQuery.startTime = undefined
// this.listQuery.endTime = undefined
// }
this.getList()
} else {
// this.handleExport()
// this.addOrEditTitle = '新增'
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
}
},
otherMethods(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
},
},
};
</script>
2024-04-25 14:43:29 +08:00
<style scoped>
.blueTip::before {
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0b58ff;
border-radius: 1px;
margin-right: 8px;
margin-top: 8px;
margin-left: 16px;
}
</style>