From 4f468bc9b4edb1557a7ae435bc0e9039a6c56964 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期二, 31 十二月 2024 11:03:48 +0800
Subject: [PATCH] 设备台账导入功能修改
---
src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue | 295 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 240 insertions(+), 55 deletions(-)
diff --git a/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue b/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
index 06ebba3..3c8955e 100644
--- a/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
+++ b/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
@@ -17,18 +17,21 @@
@click="handleSW"
:disabled=SWbuttonDistable
type="primary"
+ v-has="'dailyMaintenanceOrder:SW'"
>寮�宸�</a-button>
<a-button
:style="{marginRight: '8px'}"
@click="handleReport"
:disabled="buttonDistable"
type="primary"
+ v-has="'dailyMaintenanceOrder:report'"
>鎶ュ伐</a-button>
<a-button
:style="{marginRight: '8px'}"
@click="handleReset"
:disabled="revocationDistable"
type="primary"
+ v-has="'dailyMaintenanceOrder:reset'"
>鎾ら攢</a-button>
</a-row>
</div>
@@ -103,6 +106,38 @@
</a-form-item>
</a-col>
</a-row>
+ <a-row :gutter="24">
+ <a-col :span="17">
+ <a-form-item
+ label="闂/澶勭悊鎺柦"
+ :labelCol="{span:3}"
+ :wrapperCol="{span:18}"
+ class="hightColor"
+ >
+ <a-textarea
+ allowClear
+ :disabled="this.model.status!='4'"
+ :placeholder="'璇风淮淇汉鍛樼瀛楀~鍐欙紒'"
+ v-model="model.description"
+ />
+ </a-form-item>
+ </a-col>
+ <a-col :span="7">
+ <a-form-item
+ label="淇濆吇浜�"
+ :labelCol="{span:4}"
+ :wrapperCol="{span:17}"
+ class="hightColor"
+ >
+ <a-input
+ :disabled="this.model.status!='4'"
+ allow-clear
+ placeholder="璇疯緭鍏ヤ繚鍏讳汉"
+ v-model="model.maintenanceUserId"
+ />
+ </a-form-item>
+ </a-col>
+ </a-row>
</div>
<a-tabs
@@ -126,16 +161,16 @@
:loading="loading"
@change="handleTableChange"
:pagination="ipagination"
- :scroll="{ x: 'calc(1200px + 50%)', y: 900 }"
>
+ <!-- :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" -->
<!-- :scroll="{x:true}" -->
<template
v-for="col in columns"
:slot="col.dataIndex"
- slot-scope='text, record'
+ slot-scope='text, record, index'
>
<div :key="col.dataIndex">
- <span
+ <!-- <span
v-if=" col.dataIndex == 'photo' && !text"
style="font-size: 12px;font-style: italic;"
>鏃犲浘鐗�</span>
@@ -146,7 +181,7 @@
height="25px"
alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"
- />
+ /> -->
<!-- 绀烘剰鍥� 寮�濮� -->
<!-- <Tooltip
placement="top"
@@ -172,15 +207,54 @@
棰勮
</a> -->
+ <a-input
+ :value="text"
+ v-if="col.dataIndex == 'maintenanceOrderDetailUda1'"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ placeholder="璇疯緭鍏ヤ繚鍏讳汉"
+ :disabled="true"
+ />
+ <!-- :disabled="record.disabled" -->
+ <!-- <a-input
+ :value="text"
+ v-if="col.dataIndex == 'maintenanceOrderDetailUda2'"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ placeholder="璇疯緭鍏ユ墽琛屾儏鍐�"
+ /> -->
+ <a-textarea
+ :value="text"
+ v-if="col.dataIndex == 'maintenanceOrderDetailUda2'"
+ :maxLength="500"
+ auto-size
+ placeholder="璇疯緭鍏ユ墽琛屾儏鍐�"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="record.disabled"
+ />
</div>
-
</template>
-
</a-table>
+ <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+ <a-row :style="{textAlign:'right'}">
+ <a-button
+ :style="{marginRight: '8px'}"
+ @click="handleCancel"
+ >
+ 鍙栨秷
+ </a-button>
+ <a-button
+ @click="handleOk()"
+ type="primary"
+ :disabled="this.model.status!='4'"
+ :loading="confirmLoading"
+ >淇濆瓨</a-button>
+ </a-row>
+ <!-- v-has="'dailyMaintenanceOrder:actualWorkHoursSave'" -->
+ <!-- :disabled="false" -->
+ </div>
</div>
</a-tab-pane>
- <a-tab-pane
+ <!-- <a-tab-pane
tab='璁″垝鐢ㄦ枡'
key="2"
>
@@ -227,7 +301,7 @@
:equipmentId="this.model.equipmentId"
></actual-material-edit-table>
</div>
- </a-tab-pane>
+ </a-tab-pane>-->
<a-tab-pane
tab='瀹為檯宸ユ椂'
key="6"
@@ -277,7 +351,7 @@
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import { requestPut, getAction, downFile } from '@/api/manage'
+import { requestPut, getAction, downFile, postAction } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
import { preview } from 'vue-photo-preview'
@@ -307,7 +381,7 @@
},
data() {
return {
- title: "鏃ュ父淇濆吇宸ュ崟鎵ц",
+ title: "浜岀骇淇濆吇宸ュ崟鎵ц",
visible: false,
maskClosable: true,
confirmLoading: false,
@@ -319,6 +393,7 @@
maintenanceStandardId: '-1',
dataSource: [],
model: {},
+ form: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
@@ -326,6 +401,25 @@
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
+ },
+ /* 鍒嗛〉鍙傛暟 */
+ ipagination: {
+ current: 1,
+ pageSize: 99,
+ pageSizeOptions: ['99'],
+ showTotal: (total, range) => {
+ return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+ },
+ showQuickJumper: true,
+ showSizeChanger: true,
+ total: 0
+ },
+ validatorRules: {
+ // description: {
+ // rules: [
+ // { required: true, message: '璇疯緭鍏ユ弿杩�!' },
+ // ]
+ // }
},
columns: [
{
@@ -339,58 +433,77 @@
}
},
- {
- title: '閮ㄤ綅',
- align: 'center',
- dataIndex: 'location',
- },
+ // {
+ // title: '閮ㄤ綅',
+ // align: 'center',
+ // dataIndex: 'location',
+ // },
+ // class: "notshow"
+ // {
+ // title: '绀烘剰鍥�',
+ // align: 'center',
+ // dataIndex: 'photo',
+ // scopedSlots: { customRender: 'photo' },
+ // },
// class: "notshow"
{
- title: '绀烘剰鍥�',
+ title: '淇濆吇瑙掕壊',
align: 'center',
- dataIndex: 'photo',
- scopedSlots: { customRender: 'photo' },
+ dataIndex: 'maintenanceRole',
},
- // class: "notshow"
{
- title: '淇濆吇椤圭洰',
+ title: '淇濆吇鍐呭',
align: 'center',
dataIndex: 'maintenanceProjectNum',
},
+ // {
+ // title: '淇濆吇鏍囧噯',
+ // align: 'center',
+ // dataIndex: 'standard',
+ // },
+ // {
+ // title: '鏂规硶',
+ // align: 'center',
+ // dataIndex: 'maintenanceMethodName',
+ // },
+ // {
+ // title: '宸ュ叿',
+ // align: 'center',
+ // dataIndex: 'maintenanceTool',
+ // },
+ // {
+ // title: '瀹夊叏瑕佹眰',
+ // align: 'center',
+ // dataIndex: 'maintenanceRequire',
+ // },
+ // {
+ // title: '宸ユ椂瀹氶锛堝皬鏃讹級',
+ // align: 'center',
+ // dataIndex: 'workingHourQuota',
+ // },
+ // {
+ // title: '淇濆吇鍛ㄦ湡',
+ // align: 'center',
+ // dataIndex: 'maintenanceCycleName',
+ // },
+ // {
+ // title: '缁翠繚涓撲笟',
+ // align: 'center',
+ // dataIndex: 'maintenanceSpecialtyName',
+ // },
{
- title: '淇濆吇鏍囧噯',
+ title: '鎵ц鎯呭喌',
align: 'center',
- dataIndex: 'standard',
+ dataIndex: 'maintenanceOrderDetailUda2',
+ width: 200,
+ scopedSlots: { customRender: 'maintenanceOrderDetailUda2' },
},
{
- title: '鏂规硶',
+ title: '淇濆吇浜�',
align: 'center',
- dataIndex: 'maintenanceMethodName',
- },
- {
- title: '宸ュ叿',
- align: 'center',
- dataIndex: 'maintenanceTool',
- },
- {
- title: '瀹夊叏瑕佹眰',
- align: 'center',
- dataIndex: 'maintenanceRequire',
- },
- {
- title: '宸ユ椂瀹氶锛堝皬鏃讹級',
- align: 'center',
- dataIndex: 'workingHourQuota',
- },
- {
- title: '淇濆吇鍛ㄦ湡',
- align: 'center',
- dataIndex: 'maintenanceCycleName',
- },
- {
- title: '缁翠繚涓撲笟',
- align: 'center',
- dataIndex: 'maintenanceSpecialtyName',
+ dataIndex: 'maintenanceOrderDetailUda1',
+ width: 200,
+ scopedSlots: { customRender: 'maintenanceOrderDetailUda1' },
},
],
url: {
@@ -400,6 +513,7 @@
editStatus: "/eam/dailyMaintenanceOrder/editStatus",
revocation: "/eam/dailyMaintenanceOrder/revocation",
report: "/eam/dailyMaintenanceOrder/report",
+ edit: "/eam/dailyMaintenanceOrderDetail/edit"
},
}
},
@@ -439,11 +553,11 @@
// }
//update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
this.dataSource = res.result.records || res.result;
- if (res.result.total) {
- this.ipagination.total = res.result.total;
- } else {
- this.ipagination.total = 0;
- }
+ // if (res.result.total) {
+ // this.ipagination.total = res.result.total;
+ // } else {
+ // this.ipagination.total = 0;
+ // }
//update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
} else {
this.$message.warning(res.message)
@@ -491,6 +605,7 @@
that.buttonDistable = false
that.revocationDistable = true
that.SWbuttonDistable = true
+ that.loadData1(1)
} else {
that.$message.warning("宸ュ崟寮�宸ュけ璐ワ紒")
}
@@ -505,13 +620,31 @@
handleReport() {
const that = this;
that.confirmLoading = true;
+ for (let i = 0; i < that.dataSource.length; i++) {
+ let o = this.dataSource[i]
+ if (o.maintenanceOrderDetailUda2 == null || o.maintenanceOrderDetailUda2 == '') {
+ that.$message.warning("璇峰~鍐欑" + (i + 1) + "鎵ц鎯呭喌锛�");
+ that.confirmLoading = false;
+ return
+ }
+ // if (o.maintenanceOrderDetailUda1 == null || o.maintenanceOrderDetailUda1 == '') {
+ // that.$message.warning("璇峰~鍐欑" + (i + 1) + "淇濆吇浜猴紒");
+ // that.confirmLoading = false;
+ // return
+ // }
+ }
+ if (that.model.maintenanceUserId == null || that.model.maintenanceUserId == "") {
+ that.$message.warning("璇峰~鍐欎繚鍏讳汉锛�");
+ that.confirmLoading = false;
+ return
+ }
this.$confirm({
title: '淇濆吇宸ュ崟鎶ュ伐',
content: '鎻愮ず锛氭姤宸ュ悗淇濆吇瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�',
okText: '纭',
cancelText: '鍙栨秷',
onOk() {
- requestPut(that.url.report, { id: that.model.id, status: '5' }).then((res) => {
+ requestPut(that.url.report, { id: that.model.id, status: '5', description: that.model.description, dailyMaintenanceOrderDetails: that.dataSource, maintenanceUserId: that.model.maintenanceUserId }).then((res) => {
if (res.success) {
that.model.status = '5'
that.$message.success(res.message)
@@ -548,6 +681,7 @@
that.buttonDistable = false
that.revocationDistable = true
that.SWbuttonDistable = true
+ that.loadData1(1)
} else {
that.$message.warning(res.message)
}
@@ -560,7 +694,58 @@
},
//淇濆瓨
handleOk() {
+ const that = this
+ this.loading = true;
+ for (let i = 0; i < that.dataSource.length; i++) {
+ let o = this.dataSource[i]
+ if (o.maintenanceOrderDetailUda2 == null || o.maintenanceOrderDetailUda2 == '') {
+ that.$message.warning("璇峰~鍐欑" + (i + 1) + "鎵ц鎯呭喌锛�");
+ that.loading = false;
+ return
+ }
+ // if (o.maintenanceOrderDetailUda1 == null || o.maintenanceOrderDetailUda1 == '') {
+ // that.$message.warning("璇峰~鍐欑" + (i + 1) + "淇濆吇浜猴紒");
+ // that.loading = false;
+ // return
+ // }
+ }
+ this.form.validateFields((err, values) => {
+ if (!err) {
+ that.confirmLoading = true
+ let formData = {}
+ formData.dailyMaintenanceOrderDetails = that.dataSource;
+ let obj = obj = postAction(this.url.edit, formData)
+ obj.then((res) => {
+ if (res.success) {
+ that.$message.success("淇濆瓨鎴愬姛锛�")
+ that.$emit('ok')
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.confirmLoading = false
+ that.loadData1();
+ this.loading = false;
+ })
+ }
+ })
+ },
+
+ handleChange(value, key, column, index) {
+ let that = this;
+ const temp = [...that.dataSource];
+ const target = temp[index];
+ if (target) {
+ target[column.dataIndex] = value;
+ // if ('maintenanceOrderDetailUda1' == column.dataIndex) {
+ // target['maintenanceOrderDetailUda1'] = value.target.value;
+ // }
+ if ('maintenanceOrderDetailUda2' == column.dataIndex) {
+ target['maintenanceOrderDetailUda2'] = value.target.value;
+ }
+ that.dataSource = temp;
+ }
},
view(record) {
--
Gitblit v1.9.3