From 366d9edd9d846c99214ec06ed496b027258d3cb4 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期四, 17 七月 2025 15:47:48 +0800
Subject: [PATCH] 二保批量领取作废 添加保养规范按钮权限
---
src/mixins/JeecgListMixin.js | 200 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 186 insertions(+), 14 deletions(-)
diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js
index 8e4268d..686383d 100644
--- a/src/mixins/JeecgListMixin.js
+++ b/src/mixins/JeecgListMixin.js
@@ -4,7 +4,7 @@
* data涓璾rl瀹氫箟 list涓烘煡璇㈠垪琛� delete涓哄垹闄ゅ崟鏉¤褰� deleteBatch涓烘壒閲忓垹闄�
*/
import { filterObj } from '@/utils/util';
-import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage'
+import { deleteAction, getAction, downFile, getFileAccessHttpUrl, httpAction } from '@/api/manage'
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
import store from '@/store'
@@ -54,6 +54,9 @@
created() {
if(!this.disableMixinCreated){
console.log(' -- mixin created -- ')
+ // 姝ゅ闇�鍦╨oadData鍑芥暟涔嬪墠灏嗗弬鏁拌缃负鎵�闇�瑕佺殑鍊硷紝鍦ㄧ粍浠朵腑鐨刢reated涓棤娉曡缃紝鍥犱负mixin鐨勭敓鍛藉懆鏈熷嚱鏁版墽琛岄『搴忎紭鍏堜簬缁勪欢鐨勭敓鍛藉懆鏈熷嚱鏁�
+ const { equipmentId } = this.$route.params
+ if(equipmentId) this.$set(this.queryParam,'equipmentNum',equipmentId)
this.loadData();
//鍒濆鍖栧瓧鍏搁厤缃� 鍦ㄨ嚜宸遍〉闈㈠畾涔�
this.initDictConfig();
@@ -81,11 +84,10 @@
this.ipagination.current = 1;
}
var params = this.getQueryParams();//鏌ヨ鏉′欢
-
+ console.log('params',params)
if(!params){
return false;
}
-
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
@@ -129,7 +131,7 @@
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
- param.field = this.getQueryField();
+ if(this.columns) param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
//鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬�
@@ -139,7 +141,6 @@
return false;
}
}
-
return filterObj(param);
},
getQueryField() {
@@ -150,7 +151,6 @@
});
return str;
},
-
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
@@ -197,7 +197,7 @@
//閲嶆柊璁$畻鍒嗛〉闂
that.reCalculatePage(that.selectedRowKeys.length)
// that.$message.success(res.message);
- this.$notification.warning({
+ that.$notification.success({
message:'娑堟伅',
description:res.message
});
@@ -205,7 +205,7 @@
that.onClearSelected();
} else {
// that.$message.warning(res.message);
- this.$notification.warning({
+ that.$notification.warning({
message:'娑堟伅',
description:res.message
});
@@ -233,6 +233,7 @@
description:res.message
});
that.loadData();
+ that.clearSelected()
} else {
// that.$message.warning(res.message);
that.$notification.warning({
@@ -287,10 +288,18 @@
//娓呯┖鍒楄〃閫変腑
this.onClearSelected()
},
+ /**
+ * 鐐瑰嚮琛ㄦ牸涓鎯呮寜閽簨浠�
+ * @param record 閫変腑鐨勫綋鍓嶈鏁版嵁
+ */
handleDetail:function(record){
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title="璇︽儏";
this.$refs.modalForm.disableSubmit = true;
+ // 鎵撳紑璇︽儏鎶藉眽鏃剁鐢ㄨ澶囩紪鐮併�佽澶囧悕绉拌緭鍏ユ
+ this.$refs.modalForm.disSeach = true;
+ // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶
+ this.$refs.modalForm.removeValidate()
},
/* 瀵煎嚭 */
handleExportXls2(){
@@ -347,17 +356,25 @@
this.$warning({
title: message,
content: (<div>
- <span>{msg}</span><br/>
- <span>鍏蜂綋璇︽儏璇� <a href={href} target="_blank" download={fileName}>鐐瑰嚮涓嬭浇</a> </span>
- </div>
+ <span>{msg}</span><br/>
+ <span>鍏蜂綋璇︽儏璇� <a href={href} target="_blank" download={fileName}>鐐瑰嚮涓嬭浇</a> </span>
+ </div>
)
})
} else {
- this.$message.success(info.file.response.message || `${info.file.name} 鏂囦欢涓婁紶鎴愬姛`)
+ // this.$message.success(info.file.response.message || `${info.file.name} 鏂囦欢涓婁紶鎴愬姛`)
+ this.$notification.success({
+ message:'娑堟伅',
+ description:info.file.response.message || `${info.file.name} 鏂囦欢涓婁紶鎴愬姛`
+ });
}
this.loadData()
} else {
- this.$message.error(`${info.file.name} ${info.file.response.message}.`);
+ // this.$message.error(`${info.file.name} ${info.file.response.message}.`);
+ this.$notification.error({
+ message:'娑堟伅',
+ description:`${info.file.name} ${info.file.response.message}.`
+ });
}
} else if (info.file.status === 'error') {
this.loading = false;
@@ -379,7 +396,11 @@
})
}
} else {
- this.$message.error(`鏂囦欢涓婁紶澶辫触: ${info.file.msg} `);
+ // this.$message.error(`鏂囦欢涓婁紶澶辫触: ${info.file.msg} `);
+ this.$notification.error({
+ message:'娑堟伅',
+ description:`鏂囦欢涓婁紶澶辫触: ${info.file.msg} `
+ });
}
}
},
@@ -403,6 +424,157 @@
let url = getFileAccessHttpUrl(text)
window.open(url);
},
+
+ /**
+ * 鍗曟嵁鎵归噺鎻愪氦
+ */
+ handleSubmitBatch: function() {
+ if (!this.url.submitBatch) {
+ this.$message.error('璇疯缃畊rl.submitBatch灞炴��!')
+ return
+ }
+ if (this.selectedRowKeys.length <= 0) {
+ this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+ return
+ } else {
+ var ids = ''
+ for (var a = 0; a < this.selectedRowKeys.length; a++) {
+ ids += this.selectedRowKeys[a] + ','
+ }
+ let httpurl = this.url.submitBatch
+ let method = 'post'
+ var params = { ids: ids }
+
+ const that = this
+ httpAction(httpurl, params, method).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.loadData()
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.loading = false
+
+ })
+
+ }
+ },
+ /**
+ * 鎵归噺鎾ゅ洖宸叉彁浜ょ殑璁板綍
+ */
+ handleRevocationBatch: function() {
+ if (!this.url.revocationBatch) {
+ this.$message.error('璇疯缃畊rl.revocationBatch灞炴��!')
+ return
+ }
+ if (this.selectedRowKeys.length <= 0) {
+ this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+ return
+ } else {
+ var ids = ''
+ for (var a = 0; a < this.selectedRowKeys.length; a++) {
+ ids += this.selectedRowKeys[a] + ','
+ }
+ let httpurl = this.url.revocationBatch
+ let method = 'post'
+ var params = { ids: ids }
+
+ const that = this
+ httpAction(httpurl, params, method).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.loadData()
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.loading = false
+ })
+
+ }
+ },
+ /**
+ * 鍗曟嵁鎻愪氦
+ */
+ handleSubmit: function() {
+ if (!this.url.submit) {
+ this.$message.error('璇疯缃畊rl.submit灞炴��!')
+ return
+ }
+ if (this.selectedRowKeys.length != 1) {
+ this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+ return
+ } else {
+ var id = this.selectedRowKeys[0]
+ let httpurl = this.url.submit
+ let method = 'post'
+ var params = { id: id }
+
+ const that = this
+
+ this.$confirm({
+ title: '纭鎻愪氦锛�',
+ okText: '纭',
+ cancelText: '鍙栨秷',
+ onOk() {
+ httpAction(httpurl, params, method).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.loadData()
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.loading = false
+
+ })
+ }
+ })
+
+
+ }
+ },
+ /**
+ * 鎾ゅ洖宸叉彁浜ょ殑璁板綍
+ */
+ handleRevocation: function() {
+ if (!this.url.revocation) {
+ this.$message.error('璇疯缃畊rl.revocation灞炴��!')
+ return
+ }
+ if (this.selectedRowKeys.length != 1) {
+ this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒')
+ return
+ } else {
+ var id = this.selectedRowKeys[0]
+ let httpurl = this.url.revocation
+ let method = 'post'
+ var params = { id: id }
+
+ const that = this
+ this.$confirm({
+ title: '纭鎾ゅ洖锛�',
+ okText: '纭',
+ cancelText: '鍙栨秷',
+ onOk() {
+
+ httpAction(httpurl, params, method).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.loadData()
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.loading = false
+ })
+ }
+ })
+ }
+ }
+
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3