true)
+ .catch(() => false)
+
+ if (confirmed) {
+ const params = {
+ id: planId,
+ material_infos_plan_links_all: 1
+ }
+
+ await saveStocktakingPlan(params)
+ this.$Message.success('关联所有物资成功')
+ this.handleMaterialModalClose()
+ this.searchPlans()
+ }
+ } catch (error) {
+ this.$Message.error('关联所有物资失败')
+ console.error('关联所有物资失败:', error)
+ }
+ },
async handleMaterialSubmit() {
const planId = this.materialModal.currentPlanId
if (!planId) {
diff --git a/src/views/maintenance/maintenance_records.vue b/src/views/maintenance/maintenance_records.vue
index 31be4a4..bda5c1c 100644
--- a/src/views/maintenance/maintenance_records.vue
+++ b/src/views/maintenance/maintenance_records.vue
@@ -68,6 +68,26 @@
style="width: 120px"
/>
+
+ 实际维护日期:
+
+ -
+
+
关键词:
@@ -542,6 +562,8 @@ export default {
date_end: '',
end_date_start: '',
end_date_end: '',
+ maintenance_date_start: '',
+ maintenance_date_end: '',
keyword: '',
content: ''
},
@@ -787,7 +809,7 @@ export default {
warehouse: this.select.warehouse,
// status: this.select.status,
// date_start: this.select.date_start,
- date_end: this.select.date_end,
+ // date_end: this.select.date_end,
keyword: this.select.keyword,
filter: [
{
@@ -813,6 +835,15 @@ export default {
this.formatDate(this.select.end_date_end)
: ''
},
+ {
+ key: 'maintenance_date',
+ op: 'range',
+ value: this.select.maintenance_date_start
+ ? this.formatDate(this.select.maintenance_date_start) +
+ ',' +
+ this.formatDate(this.select.maintenance_date_end)
+ : ''
+ },
{
key: 'content',
op: 'like',
@@ -857,7 +888,11 @@ export default {
is_expire: '',
date_start: '',
date_end: '',
- keyword: ''
+ end_date_start: '',
+ end_date_end: '',
+ keyword: '',
+ maintenance_date_start: '',
+ maintenance_date_end: ''
}
this.getList()
},
@@ -1338,44 +1373,35 @@ export default {
is_export: 1,
// warehouse: this.select.warehouse,
keyword: this.select.keyword,
- filter: [
- {
- key: 'status',
- op: 'eq',
- value: this.select.status ? this.select.status : this.select.status === 0 ? 0 : ''
- },
- {
- key: 'planned_maintenance_date',
- op: 'eq',
- value: this.select.date_start ? this.formatDate(this.select.date_start) : ''
- },
- {
- key: 'maintenance_date',
- op: 'range',
- value: this.select.end_date_start
- ? this.formatDate(this.select.end_date_start) +
- ',' +
- this.formatDate(this.select.end_date_end)
- : ''
- },
- {
- key: 'content',
- op: 'like',
- value: this.select.content ? this.select.content : ''
- }
- ]
+ 'filter[0][key]': 'status',
+ 'filter[0][op]': 'eq',
+ 'filter[0][value]': this.select.status ? this.select.status : this.select.status === 0 ? 0 : '',
+ 'filter[1][key]': 'planned_maintenance_date',
+ 'filter[1][op]': 'eq',
+ 'filter[1][value]': this.select.date_start ? this.formatDate(this.select.date_start) : '',
+ 'filter[2][key]': 'end_date',
+ 'filter[2][op]': 'range',
+ 'filter[2][value]': this.select.end_date_start
+ ? this.formatDate(this.select.end_date_start) +
+ ',' +
+ this.formatDate(this.select.end_date_end) : '',
+ 'filter[3][key]': 'maintenance_date',
+ 'filter[3][op]': 'range',
+ 'filter[3][value]': this.select.maintenance_date_start
+ ? this.formatDate(this.select.maintenance_date_start) +
+ ',' +
+ this.formatDate(this.select.maintenance_date_end) : '',
+ 'filter[4][key]': 'content',
+ 'filter[4][op]': 'like',
+ 'filter[4][value]': this.select.content ? this.select.content : ''
}
if(this.select.is_expire==1 || this.select.is_expire===0){
- params.filter.push({
- key: 'end_date',
- op: this.select.is_expire ? 'lt' : 'egt',
- value: this.$moment().format('YYYY-MM-DD')
- })
- params.filter.push({
- key: 'status',
- op: 'eq',
- value: 0
- })
+ params['filter[5][key]'] = 'end_date'
+ params['filter[5][op]'] = this.select.is_expire ? 'lt' : 'egt'
+ params['filter[5][value]'] = this.$moment().format('YYYY-MM-DD')
+ params['filter[6][key]'] = 'status'
+ params['filter[6][op]'] = 'eq'
+ params['filter[6][value]'] = 0
}
// const res = await getOperationList(params)
download('/api/admin/equipment-operation/index', 'get', params, `运维记录${sheetName}.xlsx`)
diff --git a/src/views/maintenance/maintenance_rules.vue b/src/views/maintenance/maintenance_rules.vue
index ff29def..6959227 100644
--- a/src/views/maintenance/maintenance_rules.vue
+++ b/src/views/maintenance/maintenance_rules.vue
@@ -152,6 +152,7 @@
+
已选择 {{ selectedItems.length }} 项
@@ -666,6 +667,7 @@ export default {
page: this.associateCurrentPage,
'show_relation[0]': 'equipmentMaintainConfig',
'show_relation[1]': 'materialInfo.materialstorage',
+ equipment_maintain_config_id: this.currentRule?.id || '',
'materialstorages_cangkumingcheng': this.associateWarehouseName ? this.associateWarehouseName : '',
'materialstorages_suozaiquyu': this.select.area ? this.select.area : '',
@@ -849,14 +851,41 @@ export default {
this.$message.success(`批量关联成功,共关联 ${this.selectedItems.length} 项物资`)
this.selectedItems = []
this.hasSelectedItems = false
+ this.handleAssociateCancel()
this.getList()
- this.searchMaterialsPost()
+ // this.isAssociating = false
+ // this.searchMaterialsPost()
} catch (e) {
this.$message.error('批量关联失败')
} finally {
this.isAssociating = false
}
},
+ linkAllMaterials() {
+ if (!this.currentRule || !this.currentRule.id) {
+ this.$message.warning('请先选择维护规则')
+ return
+ }
+
+ this.$confirm('是否确认关联所有物资?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(async() => {
+ try {
+ await saveMaintainConfig({
+ id: this.currentRule.id,
+ equipment_maintain_config_material_infos_all: 1
+ })
+ this.$message.success('关联所有物资成功')
+ this.handleAssociateCancel()
+ this.getList()
+ } catch (e) {
+ this.$message.error('关联所有物资失败')
+ console.error('关联所有物资失败:', e)
+ }
+ })
+ },
async batchDisassociate() {
if (this.selectedItems.length === 0) {
this.$message.warning('请先选择需要取消关联的物资')
@@ -885,8 +914,9 @@ export default {
this.$message.success(`批量取消关联成功,共取消关联 ${this.selectedItems.length} 项物资`)
this.selectedItems = []
this.hasSelectedItems = false
+ this.handleAssociateCancel()
this.getList()
- this.searchMaterialsPost()
+ // this.searchMaterialsPost()
} catch (e) {
this.$message.error('批量取消关联失败')
} finally {