diff --git a/src/assets/styles/newStyle.less b/src/assets/styles/newStyle.less
index ef8706955..34d3fea50 100644
--- a/src/assets/styles/newStyle.less
+++ b/src/assets/styles/newStyle.less
@@ -906,3 +906,6 @@ tr.el-table__row{
margin: 10px;
width: calc(~'100% - 20px');
}
+.button-list {
+ padding: 5px 0px;
+}
diff --git a/src/common/axios/index.js b/src/common/axios/index.js
index 9034bc7c2..c53e52bc9 100644
--- a/src/common/axios/index.js
+++ b/src/common/axios/index.js
@@ -282,6 +282,47 @@ export default {
exeFun.call(this, err)
})
},
+ downloadFile (url, param, fileName) {
+ _axios({
+ method: 'post',
+ url,
+ data: param,
+ responseType: 'blob'
+ }).then(
+ res => {
+ const data = res.data
+ const r = new FileReader()
+ r.onload = function () {
+ try {
+ const resData = JSON.parse(this.result)
+ } catch (err) {
+ // 下载正常处理
+ // 兼容ie11
+ if (window.navigator.msSaveOrOpenBlob) {
+ try {
+ const blobObject = new Blob([data])
+ window.navigator.msSaveOrOpenBlob(blobObject, fileName)
+ } catch (e) {
+ console.log(e)
+ }
+ return
+ }
+ // a标签实现下载
+ let url = window.URL.createObjectURL(new Blob([data]))
+ let link = document.createElement('a')
+ link.style.display = 'none'
+ link.href = url
+ link.setAttribute('download', fileName)
+ document.body.appendChild(link)
+ link.click()
+ resolve(fileName)
+ }
+ }
+ r.readAsText(data) // FileReader的API
+ }).catch(res => {
+ console.log(res)
+ })
+ },
/**
* @description: delete方法
* @author: chenxiaoxi
diff --git a/src/components/CustomFormComponents/InputForAllStandards.vue b/src/components/CustomFormComponents/InputForAllStandards.vue
index 9921e957f..ed9bae380 100644
--- a/src/components/CustomFormComponents/InputForAllStandards.vue
+++ b/src/components/CustomFormComponents/InputForAllStandards.vue
@@ -226,7 +226,7 @@ export default {
this.quoteIdList1 = []
this.replaceLawsNumForm.quoteIdList = ''
}
- this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.replaceLawsNumForm, {
+ this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceLawsNumForm, {
_this: this,
loading: 'replaceLoading'
}, res => {
diff --git a/src/components/CustomFormComponents/InputForStandAndForeign.vue b/src/components/CustomFormComponents/InputForStandAndForeign.vue
index 25cd1b5f2..50545c954 100644
--- a/src/components/CustomFormComponents/InputForStandAndForeign.vue
+++ b/src/components/CustomFormComponents/InputForStandAndForeign.vue
@@ -238,7 +238,7 @@ export default {
}
this.replaceLawsNumForm.page = 1
this.replacePage = 1
- this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.replaceLawsNumForm, {
+ this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceLawsNumForm, {
_this: this,
loading: 'replaceLoading'
}, res => {
@@ -265,7 +265,7 @@ export default {
this.replaceLawsNumForm.quoteIdList = ''
}
this.replaceLawsNumForm.standType = this.config.attrField === 'CBBH' ? 'FOREIGN' : 'INLAND'
- this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.replaceLawsNumForm, {
+ this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceLawsNumForm, {
_this: this,
loading: 'replaceLoading'
}, res => {
diff --git a/src/components/CustomFormComponents/InputForStandards.vue b/src/components/CustomFormComponents/InputForStandards.vue
index f21a6c117..13cd59906 100644
--- a/src/components/CustomFormComponents/InputForStandards.vue
+++ b/src/components/CustomFormComponents/InputForStandards.vue
@@ -226,7 +226,7 @@ export default {
}
this.replaceLawsNumForm.page = 1
this.replacePage = 1
- this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.replaceLawsNumForm, {
+ this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceLawsNumForm, {
_this: this,
loading: 'replaceLoading'
}, res => {
@@ -253,7 +253,7 @@ export default {
this.replaceLawsNumForm.quoteIdList = ''
}
// this.replaceLawsNumForm.standType = this.config.attrField === 'CBBH' ? 'FOREIGN' : 'INLAND'
- this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.replaceLawsNumForm, {
+ this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceLawsNumForm, {
_this: this,
loading: 'replaceLoading'
}, res => {
diff --git a/src/components/CustomFormComponents/InputForStandardsForEnterprise.vue b/src/components/CustomFormComponents/InputForStandardsForEnterprise.vue
index d8d781c58..2dd49786c 100644
--- a/src/components/CustomFormComponents/InputForStandardsForEnterprise.vue
+++ b/src/components/CustomFormComponents/InputForStandardsForEnterprise.vue
@@ -256,7 +256,7 @@ export default {
formData.standType = this.replaceLawsNumForm.dataSource === 'INLAND_STAND' ? 'INLAND'
: this.replaceLawsNumForm.dataSource === 'FOREIGN_STAND' ? 'FOREIGN' : ''
formData.standNumber = formData.numberName
- let url = this.replaceLawsNumForm.dataSource === 'BUSINESS' ? 'lawss/sarBussionessStand/getSarBussionStandPage' : 'lawss/sarStandardsInfo/getSarStandardsInfoPage'
+ let url = this.replaceLawsNumForm.dataSource === 'BUSINESS' ? 'lawss/sarBussionessStand/getSarBussionStandPage' : 'sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage'
this.$http.get(url, formData, {
_this: this,
loading: 'replaceLoading'
diff --git a/src/components/CustomFormComponents/InputForStandardsForForeign.vue b/src/components/CustomFormComponents/InputForStandardsForForeign.vue
index e05ff727d..31d90ad21 100644
--- a/src/components/CustomFormComponents/InputForStandardsForForeign.vue
+++ b/src/components/CustomFormComponents/InputForStandardsForForeign.vue
@@ -234,7 +234,7 @@ export default {
this.quoteIdList1 = []
this.replaceLawsNumForm.quoteIdList = ''
}
- this.$http.get('lawss/sarStandardsInfo/getSarStandardsInfoPage', this.replaceLawsNumForm, {
+ this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceLawsNumForm, {
_this: this,
loading: 'replaceLoading'
}, res => {
diff --git a/src/components/treeSelect/treeSelect.vue b/src/components/treeSelect/treeSelect.vue
new file mode 100644
index 000000000..f52259f19
--- /dev/null
+++ b/src/components/treeSelect/treeSelect.vue
@@ -0,0 +1,203 @@
+
+
+
{{ sarStandardsInfoEO.standName || '-' }}
-{{ sarStandardsInfoEO.standEnName || '-' }}
-- - {{ sarStandardsInfoEO.standSortShow + ' ' + sarStandardsInfoEO.standNumber + '-' + sarStandardsInfoEO.standYear }} - {{ sarStandardsInfoEO.standSort + ' ' + sarStandardsInfoEO.standNumber }} -
-- - {{ sarStandardsInfoEO.textStatus || '-' }} -
-{{ sarStandardsInfoEO.issueTime || '-' }}
- - - -{{ sarStandardsInfoEO.standSort || '-' }}
++ + {{ sarStandardsInfoEO.standSortShow + ' ' + sarStandardsInfoEO.standNumber + '-' + sarStandardsInfoEO.standYear }} + {{ sarStandardsInfoEO.standSort + ' ' + sarStandardsInfoEO.standNumber }} +
+{{ sarStandardsInfoEO.standYear || '-' }}
+{{ sarStandardsInfoEO.standName || '-' }}
+{{ sarStandardsInfoEO.standEnName || '-' }}
+{{ sarStandardsInfoEO.standNature || '-' }}
++ + {{ sarStandardsInfoEO.textStatus || '-' }} +
+{{ sarStandardsInfoEO.issueTime || '-' }}
+{{sarStandardsInfoEO.isRelateAccess ? (sarStandardsInfoEO.isRelateAccess === '1' ? '是' : '否') : '-'}}
+{{ sarStandardsInfoEO.standSystemName || '-' }}
+ + + +@@ -901,6 +1033,7 @@ import CustomSVPPS from '@/components/CustomFormComponents/SVPPS' import CustomRoleTree from '@/components/CustomFormComponents/roleTree' import CustomDatePickWithText2 from '@/components/CustomFormComponents/DatePickerWithText2' import { interfaceUrl } from "@/sysConfig"; +import TreeSelect from '@/components/treeSelect/treeSelect.vue'; export default { name: 'foreignStandardsAndRegulations', @@ -920,7 +1053,8 @@ export default { CustomDatePickWithText, CustomSVPPS, CustomRoleTree, - CustomDatePickWithText2 + CustomDatePickWithText2, + TreeSelect }, data () { return { @@ -929,6 +1063,15 @@ export default { label: 'menuName', children: 'children' }, + defaultProps: { + children: 'children', + label: 'menuName' + }, + nodeKey: 'id', + defaultCheckedKeys: [], + productModal: false, // 模态框是否打开 + modalType: '', + productTitle: '', // 模态框标题 menuTreeLoading: true, orderBy:'', nowOrder:'', @@ -1004,6 +1147,11 @@ export default { countryOptions: [], regionOptions: [], // 区域 standSortOptions: [], // 标准类别下拉框 + standSystemOptions: [], // 标准体系下拉框 + sycpxOptions: [], // 适用产品线下拉框 + zrbmOptions: [], // 责任部门下拉框 + zrgcsOptions: [], // 责任工程师下拉框 + txlbOptions: [], // 体系类别下拉框 standSortConfigOptions: [], // 标准类别下拉框 applyArcticOptions: [], // 适用车型下拉框 standStateOptions: [], // 标准状态下拉框 @@ -1229,6 +1377,52 @@ export default { menuModalTitle: '', menuModalFlag: false, deleteMenuModal: false, + // 规范 + productRules: { + menuName: [ + {required: true, message: '一级菜单不能为空', trigger: 'blur'}, + {type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'} + ], + displaySeq: [ + {type: 'number', required: true, message: '排序号不能为空且为正整数', trigger: 'blur'}, + {type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'} + ], + remarks: [ + {type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'} + ], + dicTypeName: [ + {required: true, message: '选项不能为空', trigger: 'blur'}, + {type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'} + ], + showIndex: [ + {type: 'number', required: true, message: '排序号不能为空且为正整数', trigger: 'blur'}, + {type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'} + ], + describes: [ + {type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'} + ] + }, + productModelAdd: { + id : "", + sorDivide : "FOREIGN_STAND", + menuName : "", + parentId : null, + parentIds : null, + parentIdsName : "", + displaySeq : "", + validFlag : "", + creationTime : "", + modifyTime : "", + remarks : "", + children : [], + // 模态框信息 + dicTypeName: '', + showIndex: '', + // 描述 + describes: '', + // 唯一辨识 + dicId: "" + }, sarMenu: { id: '', parentId: '', @@ -1454,6 +1648,77 @@ export default { watch: { }, methods: { + popoverHide (checkedIds, checkedData) { + console.log(checkedIds); + console.log(checkedData); + this.sarStandardsInfoEO.standSystem = checkedData.id + console.log(this.sarStandardsInfoEO.standSystem); + }, + closeModal () { + this.productModal = false + this.closeDrawer() + }, + // 提交新增/修改 + saveProduct (name) { + this.$refs[name].validate((valid) => { + if (valid) { + if (this.modalType === 1) { + this.$http.postData('sarResource/ts-resource/add', this.productModelAdd, { + _this: this + }, res => { + if (res.ok) { + this.selectMenu() + this.productModal = false + this.productModelAdd = { + // 模态框信息 + dicTypeName: '', + showIndex: '', + // 描述 + describes: '', + // 唯一辨识 + dicId: this.$route.params.id + } + } else { + this.productModal = true + } + }, e => {}) + } else if (this.modalType === 2) { + this.$http.putData('sarResource/ts-resource', this.productModelAdd, { + _this: this + }, res => { + this.selectMenu() + this.productModal = false + this.productModelAdd = { + // 模态框信息 + dicTypeName: '', + showIndex: '', + // 描述 + describes: '', + // 唯一辨识 + dicId: this.$route.params.id + } + }, e => { + }) + } + } else { + } + }) + }, + closeDrawer () { + this.$nextTick(() => { + this.$refs['productModelAdd'].resetFields() + this.productModelAdd = { + // 模态框信息 + dicTypeName: '', + showIndex: '', + // 描述 + describes: '', + // 唯一辨识 + dicId: this.$route.params.id + } + }) + this.productModal = false + }, // 树点击 isTreeOk (checkedList) { this.shareStandardSelect = [] @@ -1596,6 +1861,7 @@ export default { const [displayLocation] = values const formFieldList = this.formFieldList this.sarStandardsInfoEO = JSON.parse(JSON.stringify(item)) + this.defaultCheckedKeys = [this.sarStandardsInfoEO.standSystem]; this.sarStandardsInfoEO.standSort = item.standSort if (this.sarStandardsInfoEO.putTime != null && this.sarStandardsInfoEO.putTime !== '') { this.sarStandardsInfoEO.putTime = this.sarStandardsInfoEO.putTime.replace(new RegExp(/-/gm), '/') @@ -1639,6 +1905,112 @@ export default { }) }) }, + // 查询二级菜单 + selectChildMenu (row) { + this.$http.get('sarResource/ts-resource/getMenuById', { + menuId: row.id + }, {}, res => { + if (res.ok) { + if(this.modalType === 1){ + let idsName = "" + if(row.parentIds !== null){ + if(row.parentIds.indexOf(res.data.id) != -1){ + this.productModelAdd.parentIds = row.parentIds + }else { + this.productModelAdd.parentIds = row.parentIds + ',' + res.data.id + idsName = row.parentIdsName + ',' + res.data.menuName + } + }else { + this.productModelAdd.parentIds = res.data.id + idsName = res.data.menuName; + } + this.productModelAdd.parentId = res.data.id + this.productModelAdd.parentIdsName = idsName + this.$forceUpdate() + }else { + this.productModelAdd = res.data + } + } + }) + }, + update(data) { + this.modalType = 2 + this.selectChildMenu(data) + this.productModal = true + // 取消所有的选中效果 + this.handleSelectAll(false) + this.productTitle = '编辑信息' + // const newChild = { id: this.id++, label: 'testtest', children: [] }; + // if (!data.children) { + // this.$set(data, 'children', []); + // } + // data.children.push(newChild); + }, + + append(data) { + this.modalType = 1 + this.selectChildMenu(data) + this.productModal = true + // 取消所有的选中效果 + this.handleSelectAll(false) + this.productTitle = '新增下级菜单信息' + this.productModelAdd.dicTypeCode = '' + // const newChild = { id: this.id++, label: 'testtest', children: [] }; + // if (!data.children) { + // this.$set(data, 'children', []); + // } + // data.children.push(newChild); + }, + + remove(node, data) { + this.$confirm('是否删除菜单?', '提示', { + confirmButtonText: '确定', + confirmButtonClass: 'common-button-primary', + cancelButtonText: '取消', + roundButton: true, + type: 'warning' + }).then(() => { + this.$http.delete("sarResource/ts-resource", { + menuId: data.id + }, res => { + }, e => { + if(e.ok){ + this.$message({ + type: 'success', + message: "删除成功" + }) + this.selectMenu() + }else { + this.$message({ + type: 'warning', + message: e.message + }) + } + }) + }).catch(() => { + this.$refs.selections.clearSelection() + this.$message({ + type: 'info', + message: '已取消删除' + }) + }) + // const parent = node.parent; + // const children = parent.data.children || parent.data; + // const index = children.findIndex(d => d.id === data.id); + // children.splice(index, 1); + }, + // 树节点鼠标移入移出 + mouseenter(data){ + console.log(data) + this.$set(data, 'show', true) + if(data.parentId !== null){ + this.$set(data, 'showDel', true) + } + }, + mouseleave(data){ + this.$set(data, 'show', false) + this.$set(data, 'showDel', false) + }, treeClick (treeNode) { this.selectSarMenu = treeNode this.standCommonlySearch.menuId = treeNode.id @@ -1884,15 +2256,14 @@ export default { if (this.saveExportType === 'apart') { if (this.selectedList != null && this.selectedList !== '') { const exportURL = interfaceUrl + 'sarStandardsInfo/sar-standards-info/exportStandardsInfoExcel?' + - 'exportType' + this.saveExportType + '&exportContent=' + this.selectedList.join(',') + '&exportName=' + this.exportName + '&standType=' + this.standType + 'exportType=' + this.saveExportType + '&exportContent=' + this.selectedList.join(',') + '&exportName=' + this.exportName + '&standType=' + this.standType window.open(exportURL) this.$message.success('导出信息成功') } } else if (this.saveExportType === 'all') { let exportEOStr = JSON.stringify(this.SarExportSearchEo) - exportEOStr = exportEOStr.replace(/""/g, null) - window.open('/api/lawss/sarStandardsInfo/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + exportEOStr + '&exportName=' + this.exportName + '&standType=' + this.standType) + window.open(interfaceUrl+'sarStandardsInfo/sar-standards-info/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + exportEOStr + '&exportName=' + this.exportName + '&standType=' + this.standType) this.$message.success('导出信息成功') } this.exportModelFlag = false @@ -2193,7 +2564,7 @@ export default { // return this.$message.warning('实施日期必须有一项为日期格式') // } this.isSubmit = true - this.$http.postData(this.addOrUPdateFlag === 1 ? 'lawss/sarStandardsInfo/addarStandardsInfo' : 'lawss/sarStandardsInfo/updateSarStandardsInfo', nowstandinfo, { + this.$http.postData(this.addOrUPdateFlag === 1 ? 'sarStandardsInfo/sar-standards-info/addarStandardsInfo' : 'sarStandardsInfo/sar-standards-info/updateSarStandardsInfo', nowstandinfo, { _this: this }, res => { this.isSubmit = false @@ -3414,16 +3785,21 @@ export default { _this: this }, res => { this.allSelectOptions = res.data || {} + this.standSortOptions = res.data.STANDCLASSIFY // 标准类别 + this.standNatureOptions = res.data.SARPROPERTY // 标准性质 + this.standStateOptions = res.data.WBZTCLASS // 文本状态 + this.standSystemOptions = res.data.BZTXCLASS // 标准体系 + this.categoryOptions = res.data.NYLXCLASS // 能源类型 + this.applyAuthOptions = res.data.SYRZCLASS // 适用认证 + this.sycpxOptions = res.data.SYCPXCLASS // 适用产品线 + this.zrbmOptions = res.data.ZRBMCLASS // 责任部门 + this.zrgcsOptions = res.data.ZRGCSCLASS // 责任工程师 + this.txlbOptions = res.data.TXLBCLASS // 体系类别 this.countryOptions = res.data.COUNTRY this.regionOptions = res.data.REGION // 区域 - this.standSortOptions = res.data.STANDCLASSIFY this.applyArcticOptions = res.data.PRODUCTTYPE // 根据需求文档,产品类别对应标准属性中的“适用车型” - this.standStateOptions = res.data.STANDSTATE - this.standNatureOptions = res.data.SARPROPERTY // 标准性质 this.adoptExtentOptions = res.data.DEGREESTANDARD this.emergyKindOptions = res.data.ENERGYTYPES - this.applyAuthOptions = res.data.PROVETYPE // 适用认证下拉框 - this.categoryOptions = res.data.CATEGORY // 能源种类 this.assemClassOptions = res.data.ASSEMCLASSIFY // 总成分类 this.categoryConfigOptions = res.data.CATEGORY this.standAttributeList = res.data.RULETYPE @@ -3470,7 +3846,7 @@ export default { position: relative; .tree-content { background: #fff; - width: 16%; + width: 20%; position: relative; .tree { width: calc(~'100% - 15px'); diff --git a/src/pages/regulatoryRepository/localProductsOrProjectLibrary/index.vue b/src/pages/regulatoryRepository/localProductsOrProjectLibrary/index.vue index 4817d13dc..e0e122a87 100644 --- a/src/pages/regulatoryRepository/localProductsOrProjectLibrary/index.vue +++ b/src/pages/regulatoryRepository/localProductsOrProjectLibrary/index.vue @@ -74,8 +74,7 @@