From 2b76d9cc1934c204149c615892e446767522423c Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 05 三月 2025 11:12:59 +0800
Subject: [PATCH] art: 删除Card标签 title信息 其它
---
src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue | 255 ++++++++++++++++++++++++--------------------------
1 files changed, 122 insertions(+), 133 deletions(-)
diff --git a/src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue b/src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue
index 9071fba..80d73fe 100644
--- a/src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue
+++ b/src/views/eam/modules/dailyMaintenanceOrder/ActualMaterialEditTable.vue
@@ -11,21 +11,37 @@
:dataSource="dataSource"
:pagination="ipagination"
@change="handleTableChange"
+ :loading="loading"
>
-
<template
v-for="col in columns"
:slot="col.dataIndex"
slot-scope='text, record, index'
>
<div :key="col.dataIndex">
- <a-input-search
- v-if="col.dataIndex == 'materialName'"
- enter-button
- @search="onSearchMaterial(index)"
+ <a-input
:value="text"
- :read-only="true"
- @change="(e) => handleChange(e, record.key, col, index)"
+ v-if="col.dataIndex == 'sparePartId'"
+ auto-size
+ placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="dailyMaintenanceOrderStatus!='4'"
+ />
+ <a-input
+ :value="text"
+ v-if="col.dataIndex == 'smoamUda2'"
+ auto-size
+ placeholder="璇疯緭鍏ュ崟浣�"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="dailyMaintenanceOrderStatus!='4'"
+ />
+ <j-dict-select-tag
+ :value='text'
+ v-if="col.dataIndex == 'smoamUda1'"
+ dictCode="material_type"
+ style="width: 100%;"
+ @change="(e)=>handleChange(e, record.key, col, index)"
+ :disabled="dailyMaintenanceOrderStatus!='4'"
/>
<a-input-number
:value="text"
@@ -33,47 +49,19 @@
:min="1"
:max="99999"
@change="(e)=>handleChange(e, record.key, col, index)"
- :disabled="record.isLock == 'yes'||dailyMaintenanceOrderStatus!='4'"
+ :disabled="dailyMaintenanceOrderStatus!='4'"
/>
-
</div>
</template>
<span
slot='action'
- slot-scope='text, record'
+ slot-scope='text, record,index'
>
- <a-popconfirm
- title="纭閿佹枡鍚�?"
- @confirm="() => handleLock(record)"
- dailyMaintenanceOrder:actualMaterialLock
- >
- <a
- v-has="'dailyMaintenanceOrder:actualMaterialLock'"
- v-if="record.isLock=='no'&&dailyMaintenanceOrderStatus=='4'"
- >閿佹枡</a>
- </a-popconfirm>
- <a-divider
- v-if="record.isLock=='no'"
- type="vertical"
- />
- <a-popconfirm
- title="瑙i攣鍚庝細鑷姩閲婃斁搴撳瓨锛岀‘璁よВ閿佸悧?"
- @confirm="() => handleUnLock(record)"
- >
- <a
- v-has="'dailyMaintenanceOrder:actualMaterialLock'"
- v-if="record.isLock=='yes'&&dailyMaintenanceOrderStatus=='4'"
- >瑙i攣</a>
- </a-popconfirm>
- <a-popconfirm
- title="纭畾鍒犻櫎鍚�?"
- @confirm="() => handleDelete(record.id)"
- >
- <a
- v-has="'dailyMaintenanceOrder:actualMaterialDelete'"
- v-if="record.isLock=='no'&&dailyMaintenanceOrderStatus=='4'"
- >鍒犻櫎</a>
- </a-popconfirm>
+ <a
+ :disabled="dailyMaintenanceOrderStatus!='4'"
+ @click='handleDeleteFake(index)'
+ >鍒犻櫎</a>
+ <!-- :disabled="mainId.status=='4'" -->
</span>
</a-table>
<a-button
@@ -97,19 +85,22 @@
type="primary"
:style="{marginRight: '8px'}"
:disabled="specialyMaintenanceOrderStatus!='4'"
- >鏆傚瓨</a-button>
+ >鏆傚瓨</a-button> -->
<a-button
@click="handleOk(0)"
type="primary"
- :disabled="specialyMaintenanceOrderStatus!='4'"
- >淇濆瓨</a-button> -->
+ :disabled="dailyMaintenanceOrderStatus!='4'"
+ >淇濆瓨</a-button>
</a-row>
<!-- :disabled="false" -->
</div>
<actual-material-select ref="actualMaterialSelect">
<!-- @sendMaterialRecord="sendMaterialRecord" -->
</actual-material-select>
- <j-select-spare-part-modal ref='JSelectSparePartModal'></j-select-spare-part-modal>
+ <j-select-spare-part-modal
+ ref='JSelectSparePartModal'
+ @selection2Rows="getSelectRows"
+ ></j-select-spare-part-modal>
</a-card>
</template>
<script>
@@ -193,67 +184,50 @@
dataSource: [],
columns: [
{
- title: '棰嗘枡鍑哄簱鍗�',
- dataIndex: 'num',
+ title: '#',
+ dataIndex: '',
+ key: 'rowIndex',
+ width: 60,
align: "center",
- width: 150,
+ customRender: function (t, r, index) {
+ return parseInt(index) + 1;
+ }
},
{
- title: '澶囦欢缂栫爜',
- dataIndex: 'sparePartNum',
+ title: '鐗╂枡鍚嶇О',
+ dataIndex: 'sparePartId',
+ scopedSlots: { customRender: 'sparePartId' },
align: "center",
-
+ // className: 'red',
+ // width: 250,
},
{
- title: '澶囦欢鍚嶇О',
- dataIndex: 'sparePartName',
+ title: '鐗╂枡绉嶇被',
+ dataIndex: 'smoamUda1',
+ scopedSlots: { customRender: 'smoamUda1' },
align: "center",
-
- },
- {
- title: '瑙勬牸',
- dataIndex: 'specification',
- align: "center",
- },
- {
- title: '鍨嬪彿',
- dataIndex: 'model',
- align: "center",
- },
- {
- title: '鍒堕�犲晢',
- dataIndex: 'constructorName',
- align: "center",
- },
- {
- title: '涓诲崟浣�',
- dataIndex: 'mainUnitName',
- align: "center",
-
- },
- {
- title: '涓绘暟閲�',
- align: 'center',
- dataIndex: 'mainQuantity'
- },
- {
- title: '鍙敤鏁伴噺',
- align: 'center',
- dataIndex: 'availableQuantity'
+ // width: 250,
},
{
title: '浣跨敤鏁伴噺',
dataIndex: 'quantity',
align: "center",
scopedSlots: { customRender: 'quantity' },
- className: 'red',
-
+ // className: 'red',
},
+ {
+ title: '鍗曚綅',
+ dataIndex: 'smoamUda2',
+
+ align: "center",
+ scopedSlots: { customRender: 'smoamUda2' },
+ // className: 'red',
+ },
+
{
title: '鎿嶄綔',
dataIndex: 'action',
align: 'center',
- width: 250,
scopedSlots: { customRender: 'action' }
}
],
@@ -265,7 +239,8 @@
lock: "/eam/maintenanceOrderActualMaterial/lock",
unLock: "/eam/maintenanceOrderActualMaterial/unLock"
},
- changeIndex: 0
+ changeIndex: 0,
+ loading: false,
}
},
watch: {
@@ -288,20 +263,23 @@
// }
// }
},
- // created() {
- // this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId;
- // this.queryParam['equipmentId'] = this.equipmentId
- // this.loadData(1);
- // },
+ created() {
+ this.queryParam['maintenanceOrderId'] = this.dailyMaintenanceOrderId;
+ this.queryParam['equipmentId'] = this.equipmentId
+ this.loadData(1);
+ },
methods: {
+ // addMaterial() {
+ // let ids = [];
+ // for (let i = 0; i < this.dataSource.length; i++) {
+ // ids.push(this.dataSource[i].outboundOrderDetailId);
+ // }
+ // this.$refs.JSelectSparePartModal.showModals(ids);
+ // this.$refs.JSelectSparePartModal.title = '閫夋嫨澶囦欢淇℃伅'
+ // this.$refs.JSelectSparePartModal.disableSubmit = false
+ // },
addMaterial() {
- let ids = [];
- for (let i = 0; i < this.dataSource.length; i++) {
- ids.push(this.dataSource[i].outboundOrderDetailId);
- }
- this.$refs.JSelectSparePartModal.showModals(ids);
- this.$refs.JSelectSparePartModal.title = '閫夋嫨澶囦欢淇℃伅'
- this.$refs.JSelectSparePartModal.disableSubmit = false
+ this.dataSource.push({ sparePartId: '', smoamUda1: '', smoamUda2: '', quantity: '', repairOrderId: this.equipmentId })
},
handleCancel() {
this.$bus.$emit('closeDrawer');
@@ -320,16 +298,16 @@
if (saveStatus == 0) {
let materialDataSource = that.dataSource;
let indexIdList = [];
- for (let i = 0; i < materialDataSource.length; i++) {
- if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') {
- that.$message.warning("璇烽�夋嫨绗�" + (i + 1) + "琛岀墿鏂欙紒");
- return false;
- }
- if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') {
- that.$message.warning("璇峰~鍐欑" + (i + 1) + "琛岀敤鏂欐暟锛�");
- return false;
- }
- }
+ // for (let i = 0; i < materialDataSource.length; i++) {
+ // if (materialDataSource[i].materialId == undefined || materialDataSource[i].materialId == null || materialDataSource[i].materialId == '') {
+ // that.$message.warning("璇烽�夋嫨绗�" + (i + 1) + "琛岀墿鏂欙紒");
+ // return false;
+ // }
+ // if (materialDataSource[i].quantity == undefined || materialDataSource[i].quantity == null || materialDataSource[i].quantity == '') {
+ // that.$message.warning("璇峰~鍐欑" + (i + 1) + "琛岀敤鏂欐暟锛�");
+ // return false;
+ // }
+ // }
}
if (that.dataSource.length === 0) {
that.$message.warning("璇锋坊鍔犵墿鏂欙紒")
@@ -362,14 +340,26 @@
console.log(column)
const temp = [...this.dataSource]
const target = temp[index]
- let availableQuantity = target['availableQuantity']
- if (target) {
- if (value != undefined && value != null && value != '' && availableQuantity < value) {
- this.$message.error('浣跨敤鏁伴噺涓嶈兘澶т簬鍙敤鏁伴噺!')
- } else {
- }
- target[column.dataIndex] = value
- this.dataSource = temp
+ // let availableQuantity = target['availableQuantity']
+ // if (target) {
+ // if (value != undefined && value != null && value != '' && availableQuantity < value) {
+ // this.$message.error('浣跨敤鏁伴噺涓嶈兘澶т簬鍙敤鏁伴噺!')
+ // } else {
+ // }
+ // target[column.dataIndex] = value
+ // this.dataSource = temp
+ // }
+ if ('sparePartId' == column.dataIndex) {
+ target['sparePartId'] = value.target.value
+ }
+ if ('smoamUda2' == column.dataIndex) {
+ target['smoamUda2'] = value.target.value
+ }
+ if ('quantity' == column.dataIndex) {
+ target['quantity'] = value
+ }
+ if ('smoamUda1' == column.dataIndex) {
+ target['smoamUda1'] = value
}
},
onSearchMaterial(index) {
@@ -413,7 +403,7 @@
this.$message.error('浣跨敤鏁伴噺涓嶈兘澶т簬鍙敤鏁伴噺!');
return false;
}
- this.confirmLoading = true;
+ this.loading = true;
postAction(this.url.lock, record).then(res => {
if (res.success) {
this.$message.success("搴撳瓨閿佸畾鎴愬姛锛�")
@@ -421,14 +411,14 @@
this.$message.error(res.message)
}
}).finally(res => {
- that.confirmLoading = false
+ that.loading = false
that.loadData();
})
},
handleUnLock(record) {
let that = this;
- this.confirmLoading = true;
+ this.loading = true;
postAction(this.url.unLock, record).then(res => {
if (res.success) {
this.$message.success("搴撳瓨瑙i攣鎴愬姛锛�")
@@ -436,7 +426,7 @@
this.$message.error(res.message)
}
}).finally(res => {
- that.confirmLoading = false
+ that.loading = false
that.loadData();
})
},
@@ -472,11 +462,8 @@
this.loading = false
})
},
- },
-
- mounted() {
- let newActualMaterials = [];
- this.$bus.$on('selection2Rows', (data) => {
+ getSelectRows(data) {
+ let newActualMaterials = [];
for (let i = 0; i < data.length; i++) {
newActualMaterials.push({
// id: this.getUuiD(16),
@@ -499,9 +486,7 @@
isLock: 'no'
})
}
- debugger
let that = this
- // newActualMaterials = this.dataSource
postAction(this.url.addInit, newActualMaterials).then((res) => {
if (res.success) {
that.$message.success(res.message)
@@ -511,10 +496,14 @@
}
}).finally(res => {
newActualMaterials = []
- that.loadData(1);
+ that.loadData();
})
- })
+
+ }
+ },
+
+ mounted() {
},
}
--
Gitblit v1.9.3