From 77485ab49cb6d2c1af8cf8a27158ecc14e2b001b Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周二, 11 6月 2024 11:06:56 +0800 Subject: [PATCH] OP30工序质量信息添加各工位质量显示 --- iwara-scada-web/src/views/main/EquipmentBaseInfo/editForm.vue | 50 +++++- iwara-scada-web/src/views/main/QualityDataInfo/index.vue | 24 +++ iwara-scada-web/src/views/main/EquipmentBaseInfo/index.vue | 6 iwara-scada-web/src/views/main/EquipmentBaseInfo/equipmentLogForm.vue | 375 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 446 insertions(+), 9 deletions(-) diff --git a/iwara-scada-web/src/views/main/EquipmentBaseInfo/editForm.vue b/iwara-scada-web/src/views/main/EquipmentBaseInfo/editForm.vue index 1a91468..1ed08dd 100644 --- a/iwara-scada-web/src/views/main/EquipmentBaseInfo/editForm.vue +++ b/iwara-scada-web/src/views/main/EquipmentBaseInfo/editForm.vue @@ -52,6 +52,14 @@ <a-form-item label="璁惧鍒堕�犲晢" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-input placeholder="璇疯緭鍏ヨ澶囧埗閫犲晢" v-decorator="['equipmentManufacturer']" /> </a-form-item> + <a-form-item label="娓呮礂娑叉坊鍔犳椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> + <a-date-picker + style="width: 100%" + placeholder="璇烽�夋嫨娓呮礂娑叉坊鍔犳椂闂�" + v-decorator="['detergentAddtime']" + @change="onChangeDetergentAddtimeTime" + /> + </a-form-item> <a-form-item label="娓呮礂娑叉洿鎹㈡椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-date-picker style="width: 100%" @@ -76,7 +84,14 @@ v-decorator="['detergentChangeCycle']" /> </a-form-item> --> - + <a-form-item label="鍒囧墛娑叉坊鍔犳椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> + <a-date-picker + style="width: 100%" + placeholder="鍒囧墛娑叉竻娲楁恫娣诲姞鏃堕棿" + v-decorator="['cuttingFluidAddTime']" + @change="onChangeCuttingFluidAddTime" + /> + </a-form-item> <a-form-item label="鍒囧墛娑叉洿鎹㈡椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-date-picker style="width: 100%" @@ -136,7 +151,9 @@ ProcessSelectData: [], record: {}, detergentchangetimeDateString: '', + detergentAddtimeString:'', cuttingFluidChangeTimeDateString: '', + cuttingFluidAddTimeString: '', knifeToolChangeTimeDateString: '', visible: false, confirmLoading: false, @@ -175,20 +192,22 @@ record.detergentchangetime != null ? moment(record.detergentchangetime, 'YYYY-MM-DD') : '', cuttingFluidChangeTime: record.cuttingFluidChangeTime != null ? moment(record.cuttingFluidChangeTime, 'YYYY-MM-DD') : '', + + detergentAddtime: + record.detergentAddtime != null ? moment(record.detergentAddtime, 'YYYY-MM-DD') : '', + cuttingFluidAddTime: + record.cuttingFluidAddTime != null ? moment(record.cuttingFluidAddTime, 'YYYY-MM-DD') : '', + cuttingFluidChangeAlertThreshold: record.cuttingFluidChangeAlertThreshold, tactTime: record.tactTime - // knifeToolChangeTime: record.knifeToolChangeTime != null ? moment(record.knifeToolChangeTime, 'YYYY-MM-DD') : '' - // knifeToolChangeTime:moment(record.knifeToolChangeTime != null ? record.knifeToolChangeTime : "", 'YYYY-MM-DD'), }) //瑙﹀彂浜嬩欢 this.onChangedetergentchangetime(null,record.detergentchangetime != null ? dateFormat(record.detergentchangetime, 'YYYY-mm-dd') : ''); this.onChangecuttingFluidchangetime(null,record.cuttingFluidChangeTime != null ? dateFormat(record.cuttingFluidChangeTime, 'YYYY-mm-dd') : ''); + this.onChangeCuttingFluidAddTime(null,record.cuttingFluidAddTime != null ? dateFormat(record.cuttingFluidAddTime, 'YYYY-mm-dd') : ''); + this.onChangeDetergentAddtimeTime(null,record.detergentAddtime != null ? dateFormat(record.detergentAddtime, 'YYYY-mm-dd') : ''); }) - // this.form.getFieldDecorator('detergentchangetime', { initialValue: moment(record.detergentchangetime, 'YYYY-MM-DD') }) - // this.detergentchangetimeDateString = moment(record.detergentchangetime).format('YYYY-MM-DD') - // this.form.getFieldDecorator('knifeToolChangeTime', { initialValue: moment(record.knifeToolChangeTime, 'YYYY-MM-DD') }) - // this.knifeToolChangeTimeDateString = moment(record.knifeToolChangeTime).format('YYYY-MM-DD') }, handleSubmit() { const { @@ -207,8 +226,14 @@ } } values.detergentchangetime = this.detergentchangetimeDateString - this.record.detergentchangetime = this.detergentchangetimeDateString + this.record.detergentchangetime = this.detergentAddtimeString + this.record.detergentAddtime = this.detergentchangetimeDateString this.record.cuttingFluidChangeTime = this.cuttingFluidChangeTimeDateString + this.record.cuttingFluidAddTime = this.cuttingFluidAddTimeString + + this.record.cuttingFluidAddTime = this.cuttingFluidAddTimeString + this.record.detergentAddtime = this.detergentAddtimeString + // values.knifeToolChangeTime = this.knifeToolChangeTimeDateString // this.record.knifeToolChangeTime = this.knifeToolChangeTimeDateString EquipmentBaseInfoEdit(this.record) @@ -234,9 +259,16 @@ //debugger this.detergentchangetimeDateString = dateString }, + onChangeDetergentAddtimeTime(date, dateString) { + //debugger + this.detergentAddtimeString = dateString + }, onChangecuttingFluidchangetime(date, dateString) { this.cuttingFluidChangeTimeDateString = dateString + }, + onChangeCuttingFluidAddTime(date, dateString) { + this.cuttingFluidAddTimeString = dateString }, onChangeknifeToolChangeTime(date, dateString) { this.knifeToolChangeTimeDateString = dateString @@ -246,7 +278,9 @@ this.record.detergentchangetime = '' this.record.cuttingFluidChangeTime = '' this.detergentchangetimeDateString = '' + this.detergentAddtimeString = '' this.cuttingFluidChangeTimeDateString = '' + this.cuttingFluidAddTimeString = '' this.visible = false } } diff --git a/iwara-scada-web/src/views/main/EquipmentBaseInfo/equipmentLogForm.vue b/iwara-scada-web/src/views/main/EquipmentBaseInfo/equipmentLogForm.vue new file mode 100644 index 0000000..3a452c5 --- /dev/null +++ b/iwara-scada-web/src/views/main/EquipmentBaseInfo/equipmentLogForm.vue @@ -0,0 +1,375 @@ +锘�<template> + <a-modal + title="璁惧鎿嶄綔鍘嗗彶琛�" + :width="1200" + :hight="1200" + :visible="visible" + :confirmLoading="confirmLoading" + @ok="handleSubmit" + @cancel="handleCancel" + > + + <x-card :bordered="false"> + <div slot="content" class="table-page-search-wrapper"> + + <a-form :label-col="labelCol" :wrapper-col="wrapperCol"> + <s-table + ref="table" + :columns="columns" + :rowKey="(record) => record.id" + </s-table> + <a-row :gutter="gutter"> + <a-col :md="colMd" :sm="colSm"> + <a-form-item label="宸ュ簭"> + <a-select allow-clear style="width: 100%" v-model="queryParam.WorkingProcedure" placeholder="璇烽�夋嫨"> + <a-select-option v-for="(item,index) in ProcessSelectData" :key="index" :value="item.code"> + {{ item.name }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <!-- <a-col :md="colMd" :sm="colSm"> + <a-form-item label="璁惧鍚嶇О"> + <a-select + show-search + option-filter-prop="children" + :filter-option="filterOption" + :allowClear="true" + style="width: 100%" + v-model="queryParam.EquipmentID" + placeholder="璇烽�夋嫨"> + <a-select-option v-for="(item, index) in equitypeData" :key="index" :value="item.equipmentId">{{ + item.equipmentName }}</a-select-option> + </a-select> + </a-form-item> + </a-col> --> + <a-col :md="colMd" :sm="colSm"> + <a-form-item label="璁惧鍨嬪彿"> + <a-input v-model="queryParam.equipmentModel" allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�"/> + </a-form-item> + </a-col> + <a-col :md="colMd" :sm="colSm" > + <span class="table-page-search-submitButtons"> + <a-button type="primary" @click="$refs.table.refresh(true)" >鏌ヨ</a-button> + <a-button style="margin-left: 8px" @click="() => queryParam = {}">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + </x-card> + + <a-card :bordered="false"> + + </a-card> + </a-modal> +</template> + +<script> +import { STable,XCard } from '@/components' +import moment from 'moment' +import { EquipmentBaseInfoEdit } from '@/api/modular/main/EquipmentBaseInfoManage' +import { + EquipmentBaseInfoPage, + EquipmentBaseInfoToExcel, + EquipmentBaseInfoDelete, + EquipmentBaseInfoSelectDelete, + getEquipmentName } from '@/api/modular/main/EquipmentBaseInfoManage' +import { dateFormat } from '@/utils/util' +export default { + components: { + STable, + XCard + }, + data() { + return { + Id: 0, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + queryParam:{ + + }, + ProcessSelectData: [], + record: {}, + detergentchangetimeDateString: '', + detergentAddtimeString:'', + cuttingFluidChangeTimeDateString: '', + cuttingFluidAddTimeString: '', + knifeToolChangeTimeDateString: '', + visible: false, + confirmLoading: false, + form: this.$form.createForm(this), + + // 璁惧涓嬫媺妗嗘暟鎹� + equitypeData: [], + + gutter: 36, + colMd: 6, + colSm: 18, + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + columns: [ + { + title: '搴忓彿', + width: '50px', + dataIndex: 'index', + key: 'index', + align: 'center', + customRender: (text, record, index) => `${index + 1}` + }, + { + title: '宸ュ簭', + align: 'center', + sorter: true, + dataIndex: 'workingProcedure' + }, + { + title: '璁惧缂栧彿', + align: 'center', + sorter: true, + dataIndex: 'equipmentId' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName' + }, + { + title: '鏈哄簥鏁版帶绯荤粺鍨嬪彿', + align: 'center', + dataIndex: 'equipmentModel' + }, + { + title: '浜у搧鏁版嵁淇℃伅', + align: 'center', + // sorter: true, + dataIndex: 'equipmentFunction' + }, + { + title: '娓呮礂娑叉洿鎹㈡椂闂�', + align: 'center', + sorter: true, + dataIndex: 'detergentchangetime' + }, + { + title: '娓呮礂娑叉洿鎹㈤璀﹂槇鍊�', + align: 'center', + sorter: true, + dataIndex: 'detergentChangeAlertThreshold' + }, + // { + // title: '娓呮礂娑叉洿鎹㈠懆鏈�', + // align: 'center', + // sorter: true, + // dataIndex: 'detergentChangeCycle' + // }, + { + title: '鍒囧墛娑叉洿鎹㈡椂闂�', + align: 'center', + sorter: true, + dataIndex: 'cuttingFluidChangeTime' + }, + { + title: '鍒囧墛娑叉洿鎹㈤璀﹂槇鍊�', + align: 'center', + sorter: true, + dataIndex: 'cuttingFluidChangeAlertThreshold' + }, + { + title: ' 璁″垝鑺傛媿', + align: 'center', + sorter: true, + dataIndex: 'tactTime', + customRender: (text, record, index) => `${text}s` + }, + { + title: 'IP鍦板潃', + align: 'center', + // sorter: true, + dataIndex: 'equipmentIP' + }, + { + title: '璁惧鍒堕�犲晢', + align: 'center', + // sorter: true, + dataIndex: 'equipmentManufacturer' + }, + { + title: '鍒涘缓鏃堕棿', + align: 'center', + sorter: true, + dataIndex: 'createdTime', + scopedSlots: { + customRender: 'time' + } + } + ], + tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, + // 鍔犺浇鏁版嵁鏂规硶 蹇呴』涓� Promise 瀵硅薄 + loadData: parameter => { + return EquipmentBaseInfoPage(Object.assign(parameter, this.switchingDate())).then((res) => { + return res.data + }) + }, + } + }, + created() { + this.ProcessSelectData = this.$options.filters['dictData']('process_type') + }, + methods: { + moment, + // 鍒濆鍖栨柟娉� + edit(record) { + this.getEquipmentName(); + console.log(record) + this.visible = true + // this.Id = record.id + this.$nextTick(() => {}) + // 娣卞害鎷疯礉 绉婚櫎VUE鐨勭洃鍚紝闃叉INDEX椤甸潰鍊煎彉鍔� + //this.record = JSON.parse(JSON.stringify(record)) + this.$nextTick(() => { + // this.form.setFieldsValue({ + // id: record.id, + // equipmentId: record.equipmentId, + // equipmentName: record.equipmentName, + // workingProcedure: record.workingProcedure, + // equipmentModel: record.equipmentModel, + // equipmentIP: record.equipmentIP, + // equipmentFunction: record.equipmentFunction, + // equipmentBrand: record.equipmentBrand, + // equipmentManufacturer: record.equipmentManufacturer, + // detergentChangeAlertThreshold: record.detergentChangeAlertThreshold, + // detergentChangeCycle: record.detergentChangeCycle, + // // knifeToolChangeAlertThreshold: record.knifeToolChangeAlertThreshold, + // remarks: record.remarks, + // detergentchangetime: + // record.detergentchangetime != null ? moment(record.detergentchangetime, 'YYYY-MM-DD') : '', + // cuttingFluidChangeTime: + // record.cuttingFluidChangeTime != null ? moment(record.cuttingFluidChangeTime, 'YYYY-MM-DD') : '', + + // detergentAddtime: + // record.detergentAddtime != null ? moment(record.detergentAddtime, 'YYYY-MM-DD') : '', + // cuttingFluidAddTime: + // record.cuttingFluidAddTime != null ? moment(record.cuttingFluidAddTime, 'YYYY-MM-DD') : '', + + // cuttingFluidChangeAlertThreshold: record.cuttingFluidChangeAlertThreshold, + // tactTime: record.tactTime + // }) + + // //瑙﹀彂浜嬩欢 + // this.onChangedetergentchangetime(null,record.detergentchangetime != null ? dateFormat(record.detergentchangetime, 'YYYY-mm-dd') : ''); + // this.onChangecuttingFluidchangetime(null,record.cuttingFluidChangeTime != null ? dateFormat(record.cuttingFluidChangeTime, 'YYYY-mm-dd') : ''); + // this.onChangeCuttingFluidAddTime(null,record.cuttingFluidAddTime != null ? dateFormat(record.cuttingFluidAddTime, 'YYYY-mm-dd') : ''); + // this.onChangeDetergentAddtimeTime(null,record.detergentAddtime != null ? dateFormat(record.detergentAddtime, 'YYYY-mm-dd') : ''); + }) + }, + // 璁惧鏌ヨ妗嗙瓫閫� + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + ) + }, + getEquipmentName() { + // 鑾峰彇璁惧鍚嶇О + getEquipmentName().then(res => { + this.equitypeData = res.data + }) + }, + handleSubmit() { + const { + form: { validateFields } + } = this + this.confirmLoading = true + validateFields((errors, values) => { + if (!errors) { + for (const key in values) { + if (values[key] == null) continue + if (typeof values[key] === 'object') { + values[key] = JSON.stringify(values[key]) + this.record[key] = values[key] + } else { + this.record[key] = values[key] + } + } + values.detergentchangetime = this.detergentchangetimeDateString + this.record.detergentchangetime = this.detergentAddtimeString + this.record.detergentAddtime = this.detergentchangetimeDateString + this.record.cuttingFluidChangeTime = this.cuttingFluidChangeTimeDateString + this.record.cuttingFluidAddTime = this.cuttingFluidAddTimeString + + this.record.cuttingFluidAddTime = this.cuttingFluidAddTimeString + this.record.detergentAddtime = this.detergentAddtimeString + + // values.knifeToolChangeTime = this.knifeToolChangeTimeDateString + // this.record.knifeToolChangeTime = this.knifeToolChangeTimeDateString + EquipmentBaseInfoEdit(this.record) + .then(res => { + if (res.success) { + this.$message.success('缂栬緫鎴愬姛') + this.confirmLoading = false + this.$emit('ok', this.record) + this.handleCancel() + } else { + this.$message.error('缂栬緫澶辫触锛�' + JSON.stringify(res.message)) + } + }) + .finally(res => { + this.confirmLoading = false + }) + } else { + this.confirmLoading = false + } + }) + }, + onChangedetergentchangetime(date, dateString) { + //debugger + this.detergentchangetimeDateString = dateString + }, + onChangeDetergentAddtimeTime(date, dateString) { + //debugger + this.detergentAddtimeString = dateString + }, + + onChangecuttingFluidchangetime(date, dateString) { + this.cuttingFluidChangeTimeDateString = dateString + }, + onChangeCuttingFluidAddTime(date, dateString) { + this.cuttingFluidAddTimeString = dateString + }, + onChangeknifeToolChangeTime(date, dateString) { + this.knifeToolChangeTimeDateString = dateString + }, + handleCancel() { + this.form.resetFields() + this.record.detergentchangetime = '' + this.record.cuttingFluidChangeTime = '' + this.detergentchangetimeDateString = '' + this.detergentAddtimeString = '' + this.cuttingFluidChangeTimeDateString = '' + this.cuttingFluidAddTimeString = '' + this.visible = false + } + } +} +</script> +<style lang="less"> + .table-operator { + margin-bottom: 18px; + } + button { + margin-right: 8px; + } +</style> \ No newline at end of file diff --git a/iwara-scada-web/src/views/main/EquipmentBaseInfo/index.vue b/iwara-scada-web/src/views/main/EquipmentBaseInfo/index.vue index f28e2e5..942435c 100644 --- a/iwara-scada-web/src/views/main/EquipmentBaseInfo/index.vue +++ b/iwara-scada-web/src/views/main/EquipmentBaseInfo/index.vue @@ -62,6 +62,7 @@ <a-button :disabled="btnDisabled" type="primary" v-if="hasPerm('EquipmentBaseInfo:add')" icon="plus" @click="EquipmentBaseInfoSelectDelete(selectedRows)">鎵归噺鍒犻櫎閫変腑椤�</a-button> <a-button type="primary" v-if="hasPerm('EquipmentBaseInfo:add')" icon="plus" @click="$refs.addForm.add()">鏂板缓</a-button> <a-button style="margin-left: 8px" type="info" icon="download" @click=" EquipmentBaseInfoToExcel()">瀵煎嚭Excel</a-button> + <a-button style="margin-left: 8px" type="info" icon="download" @click="$refs.equipmentLogForm.edit()">鏌ョ湅鍘嗗彶</a-button> </template> <span slot="action" slot-scope="text, record"> <a v-if="hasPerm('EquipmentBaseInfo:edit')" @click="$refs.editForm.edit(record)">缂栬緫</a> @@ -73,6 +74,7 @@ </s-table> <add-form ref="addForm" @ok="handleOk" /> <edit-form ref="editForm" @ok="handleOk" /> + <equipmentLog-form ref="equipmentLogForm" @ok="handleOk" /> </a-card> </div> </template> @@ -89,12 +91,14 @@ import addForm from './addForm.vue' import editForm from './editForm.vue' + import equipmentLogForm from './equipmentLogForm.vue' export default { components: { STable, XCard, addForm, - editForm + editForm, + equipmentLogForm }, data () { return { diff --git a/iwara-scada-web/src/views/main/QualityDataInfo/index.vue b/iwara-scada-web/src/views/main/QualityDataInfo/index.vue index cc3f9bd..bf6bc96 100644 --- a/iwara-scada-web/src/views/main/QualityDataInfo/index.vue +++ b/iwara-scada-web/src/views/main/QualityDataInfo/index.vue @@ -222,6 +222,30 @@ ], EOP30: [ { + title: 'CH3璐ㄩ噺', + align: 'center', + sorter: true, + dataIndex: 'oP30QualityStateCH3Name' + }, + { + title: 'CH4璐ㄩ噺', + align: 'center', + sorter: true, + dataIndex: 'oP30QualityStateCH4Name' + }, + { + title: 'CH5璐ㄩ噺', + align: 'center', + sorter: true, + dataIndex: 'oP30QualityStateCH5Name' + }, + { + title: 'CH6璐ㄩ噺', + align: 'center', + sorter: true, + dataIndex: 'oP30QualityStateCH6Name' + }, + { title: '娑ㄦ柇鍔涚煩', align: 'center', sorter: true, -- Gitblit v1.9.3