From ead9635b902a060599264d2bdcb5399d5938cadd Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期五, 10 五月 2024 16:05:05 +0800
Subject: [PATCH] 设备加工工件报表页面修复点击左侧树右侧无法正常展示数据问题
---
src/views/eam/modules/daily3MaintenanceOrder/Maintenance3ReceiptModal.vue | 235 +++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 167 insertions(+), 68 deletions(-)
diff --git a/src/views/eam/modules/daily3MaintenanceOrder/Maintenance3ReceiptModal.vue b/src/views/eam/modules/daily3MaintenanceOrder/Maintenance3ReceiptModal.vue
index 5eef2e1..58774f0 100644
--- a/src/views/eam/modules/daily3MaintenanceOrder/Maintenance3ReceiptModal.vue
+++ b/src/views/eam/modules/daily3MaintenanceOrder/Maintenance3ReceiptModal.vue
@@ -7,14 +7,20 @@
cancelText="鍏抽棴"
@cancel="handleCancel"
:confirmLoading="confirmLoading"
+ title="闄勫綍4"
>
<!-- :title="title" -->
<a-spin :spinning="confirmLoading">
<a-form :form="form">
+ <span
+ class="ant-descriptions-title"
+ style="font-size: large;font-size: 15px;float: right;"
+ >{{this.model.receiptsNum}}</span>
<a-divider
orientation="center"
style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
- > 鐢熶骇璁惧涓夌骇淇濆吇楠屾敹鍗� </a-divider>
+ > {{this.model.receiptsName}} </a-divider>
+ <!-- 鐢熶骇璁惧涓夌骇淇濆吇楠屾敹鍗� -->
<a-row :gutter="24">
<a-col :span="8">
<a-form-item
@@ -47,69 +53,108 @@
</a-form-item>
</a-col>
</a-row>
+ <a-table
+ ref="table"
+ bordered
+ rowKey="id"
+ :columns="columns"
+ :dataSource="dataSource"
+ :pagination="false"
+ >
+ <!-- @change="handleTableChange" -->
+ <!-- :pagination="ipagination" -->
+ <template
+ v-for="col in columns"
+ :slot="col.dataIndex"
+ slot-scope='text, record, index'
+ >
+ <div :key="col.dataIndex">
+ <a-input
+ :value="text"
+ v-if="col.dataIndex == 'position'"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="false"
+ placeholder="璇疯緭鍏ヤ繚鍏婚儴浣�"
+ />
+ <a-textarea
+ :value="text"
+ v-if="col.dataIndex == 'content'"
+ :maxLength="500"
+ auto-size
+ placeholder="璇疯緭鍏ヤ繚鍏诲唴瀹�"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="true"
+ />
+ <a-textarea
+ :value="text"
+ v-if="col.dataIndex == 'standard'"
+ :maxLength="500"
+ auto-size
+ placeholder="璇疯緭鍏ヤ繚鍏绘爣鍑�"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="true"
+ />
+ <a-select
+ v-if="col.dataIndex == 'firstInspect'"
+ :value="text"
+ @change="(e) => handleChange(e, record.key, col, index)"
+ style="width: 100%"
+ >
+ <a-select-option value="1">閫氳繃</a-select-option>
+ <a-select-option value="2">鏈�氳繃</a-select-option>
+ </a-select>
+ <a-input
+ v-if="col.dataIndex == 'firstInspect' && record.firstInspect == '2'"
+ :value="record.firstNotPass"
+ @change="(e)=>handleChange2(e, record.key, col, index)"
+ :disabled="false"
+ placeholder="璇峰~鍐欓獙鏀舵湭閫氳繃鍘熷洜"
+ />
+ <a-select
+ v-if="col.dataIndex == 'secondInspect'"
+ :value="text"
+ @change="(e) => handleChange(e, record.key, col, index)"
+ style="width: 100%"
+ >
+ <a-select-option value="1">閫氳繃</a-select-option>
+ <a-select-option value="2">鏈�氳繃</a-select-option>
+ </a-select>
+ <!-- <a-input
+ v-if="col.dataIndex == 'secondInspect' && record.secondInspect == '2'"
+ :value="record.secondNotPass"
+ @change="(e)=>handleChange2(e, record.key, col, index)"
+ :disabled="false"
+ placeholder="璇峰~鍐欓獙鏀舵湭閫氳繃鍘熷洜"
+ /> -->
+ </div>
+ </template>
+ </a-table>
+ <!-- <div :style="{height: '140px',width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+ <a-row :gutter="24">
+ <a-col :span="24">
+ <a-form-item
+ :labelCol="{span:3}"
+ :wrapperCol="{span:21}"
+ label="楠屾敹鏈�氳繃鍘熷洜"
+ >
+ <a-textarea
+ allow-clear
+ :rows='5'
+ :disabled="disableSubmit"
+ :placeholder="disableSubmit?'':'璇疯緭鍏ラ獙鏀舵湭閫氳繃鍘熷洜'"
+ v-decorator="['notPassReason', {}]"
+ />
+
+ </a-form-item>
+ </a-col>
+ </a-row>
+ </div> -->
</a-form>
</a-spin>
- <a-table
- ref="table"
- bordered
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="false"
- >
- <!-- @change="handleTableChange" -->
- <!-- :pagination="ipagination" -->
- <template
- v-for="col in columns"
- :slot="col.dataIndex"
- slot-scope='text, record, index'
- >
- <div :key="col.dataIndex">
- <a-input
- :value="text"
- v-if="col.dataIndex == 'position'"
- @change="(e)=>handleChange(e, record.key, col, index)"
- :disabled="false"
- placeholder="璇疯緭鍏ヤ繚鍏婚儴浣�"
- />
- <a-textarea
- :value="text"
- v-if="col.dataIndex == 'content'"
- :maxLength="500"
- auto-size
- placeholder="璇疯緭鍏ヤ繚鍏诲唴瀹�"
- @change="(e)=>handleChange(e, record.key, col, index)"
- />
- <a-textarea
- :value="text"
- v-if="col.dataIndex == 'standard'"
- :maxLength="500"
- auto-size
- placeholder="璇疯緭鍏ヤ繚鍏绘爣鍑�"
- @change="(e)=>handleChange(e, record.key, col, index)"
- :disabled="false"
- />
- <a-input
- :value="text"
- v-if="col.dataIndex == 'firstInspect'"
- @change="(e)=>handleChange(e, record.key, col, index)"
- :disabled="false"
- placeholder="璇疯緭鍏ョ涓�娆℃"
- />
- <a-input
- :value="text"
- v-if="col.dataIndex == 'secondInspect'"
- @change="(e)=>handleChange(e, record.key, col, index)"
- :disabled="false"
- placeholder="璇疯緭鍏ョ浜屾妫�"
- />
- </div>
- </template>
- </a-table>
<div :style="{height: '60px',width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
<a-row :gutter="24">
- <a-col :span="12">
+ <a-col :span="7">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@@ -119,7 +164,7 @@
<span v-else>-</span>
</a-form-item>
</a-col>
- <a-col :span="12">
+ <a-col :span="17">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@@ -131,12 +176,12 @@
</a-col>
</a-row>
</div>
- <a-button
+ <!-- <a-button
style="width: 100%; margin-top: 0px; margin-bottom: 8px"
type="dashed"
icon="plus"
@click="addHour"
- >娣诲姞鍐呭</a-button>
+ >娣诲姞鍐呭</a-button> -->
<template slot="footer">
<a-button
:style="{marginRight: '8px'}"
@@ -200,6 +245,23 @@
dataIndex: 'standard',
scopedSlots: { customRender: 'standard' }
},
+ // {
+ // title: '楠屾敹娆℃暟',
+ // children: [
+ // {
+ // title: '绗竴娆℃',
+ // dataIndex: 'firstInspect',
+ // align: 'center',
+ // scopedSlots: { customRender: 'firstInspect' }
+ // },
+ // {
+ // title: '绗簩娆℃',
+ // dataIndex: 'secondInspect',
+ // align: 'center',
+ // scopedSlots: { customRender: 'secondInspect' }
+ // },
+ // ],
+ // },
{
title: '绗竴娆℃',
align: 'center',
@@ -234,24 +296,28 @@
add: "/eam/maintenanceThreeAcceptance/add",
getMaintenance3Receipt: "/eam/maintenanceThreeAcceptance/getMaintenanceThreeAcceptanceList",
list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId",
+ getSysFileName: "/eam/sysFileName/getSysFileName",
},
}
},
methods: {
- addHour() {
- this.dataSource.push({ id: '', maintenanceOrderId: this.model.id, position: '', content: '', standard: '', firstInspect: '', secondInspect: '' })
- },
+ // addHour() {
+ // this.dataSource.push({ id: '', maintenanceOrderId: this.model.id, position: '', content: '', standard: '', firstInspect: '', secondInspect: '' })
+ // },
edit(record) {
let that = this;
+ if (record.receipts == "" || record.receipts == null) {
+ this.getSysFileName()
+ }
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.getMaintenance3Receipt()
that.$nextTick(() => {
- // that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark'));
+ that.form.setFieldsValue(pick(that.model, 'notPassReason'));
});
},
@@ -277,6 +343,13 @@
const that = this;
// 瑙﹀彂琛ㄥ崟楠岃瘉
+ for (let i = 0; i < that.dataSource.length; i++) {
+ let o = that.dataSource[i]
+ if (o.firstInspect == "2" && o.secondInspect == "2") {
+ that.$message.warning("楠屾敹鍗曠" + (i + 1) + "琛岋紝涓ゆ妫�楠屽潎涓轰笉閫氳繃锛岃閲嶆柊妫�楠岃椤逛繚鍏诲唴瀹癸紒");
+ return
+ }
+ }
that.form.validateFields((err, values) => {
if (!err) {
this.$confirm({
@@ -321,16 +394,42 @@
target['standard'] = value.target.value;
}
if (column.dataIndex == 'firstInspect') {
- target[column.dataIndex] = value.target.value;
+ target["firstInspect"] = value;
}
if (column.dataIndex == 'secondInspect') {
- target[column.dataIndex] = value.target.value;
+ target[column.dataIndex] = value;
}
//鏄剧ず甯﹁繃鏉ョ殑鏁版嵁
that.dataSource = temp;
}
},
+ handleChange2(value, key, column, index, record) {
+ let that = this;
+ const temp = [...that.dataSource];
+ const target = temp.filter(item => key === item.key)[index];
+ if (target) {
+ // target[column.dataIndex] = value;
+ if ('firstInspect' == column.dataIndex) {
+ target['firstNotPass'] = value.target.value;
+ }
+ // if ('secondInspect' == column.dataIndex) {
+ // target['secondNotPass'] = value.target.value;
+ // }
+
+ //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁
+ that.dataSource = temp;
+ }
+ },
+
+ getSysFileName() {
+ getAction(this.url.getSysFileName, { name: '19' }).then((res) => {
+ if (res.success) {
+ this.model = Object.assign(this.model, res.result[0]);
+ }
+ })
+ },
+
},
}
</script>
--
Gitblit v1.9.3