diff --git a/src/api/chooselist/chooselist.js b/src/api/chooselist/chooselist.js index 586336a..8f6efcf 100644 --- a/src/api/chooselist/chooselist.js +++ b/src/api/chooselist/chooselist.js @@ -5,3 +5,11 @@ export const getChooselist = data => createAPI(`api/chooselist/getChooselist/${d export const getChooselistData = data => createAPI(`api/chooselist/getChooselistData`,'post',data) + + + + +export const getChooselistEam = data => createAPI(`api/pms/chooselist/getChooselist/${data.tagNo}`,'get',data) + + +export const getChooselistDataEam = data => createAPI(`api/pms/chooselist/getChooselistData`,'post',data) diff --git a/src/api/eam/eam.js b/src/api/eam/eam.js index c4d615b..e58d5da 100644 --- a/src/api/eam/eam.js +++ b/src/api/eam/eam.js @@ -83,3 +83,8 @@ export const eamPropertiesModelSave = data => createAPI(`api/pms/eam/eamProperti export const eamPropertiesModelEdit = data => createAPI(`api/pms/eam/eamPropertiesModelEdit`,'post',data) export const eamPropertiesModelDelete = data => createAPI(`api/pms/eam/eamPropertiesModelDelete`,'post',data) + +export const searchModalDetails = data => createAPI(`api/pms/eam/searchModalDetails`,'post',data) + +export const saveModalDetails = data => createAPI(`api/pms/eam/saveModalDetails`,'post',data) +export const deleteModalDetails = data => createAPI(`api/pms/eam/deleteModalDetails`,'post',data) diff --git a/src/views/modules/common/Chooselist_eam.vue b/src/views/modules/common/Chooselist_eam.vue new file mode 100644 index 0000000..bb77080 --- /dev/null +++ b/src/views/modules/common/Chooselist_eam.vue @@ -0,0 +1,215 @@ + + + + diff --git a/src/views/modules/eam/eamGroup.vue b/src/views/modules/eam/eamGroup.vue index cbb4a80..deefda0 100644 --- a/src/views/modules/eam/eamGroup.vue +++ b/src/views/modules/eam/eamGroup.vue @@ -68,7 +68,7 @@ @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" - :page-sizes="[20, 50, 100, 1000]" + :page-sizes="[20, 100, 500, 1000]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> diff --git a/src/views/modules/eam/eamPropertiesItem.vue b/src/views/modules/eam/eamPropertiesItem.vue index 46184fc..3ddf02d 100644 --- a/src/views/modules/eam/eamPropertiesItem.vue +++ b/src/views/modules/eam/eamPropertiesItem.vue @@ -331,6 +331,24 @@ fixed: '', columnWidth: 100, }, + { + userId: this.$store.state.user.name, + functionId: 101008, + serialNumber: '101008TableValueChooseFlag', + tableId: "101008Table", + tableName: "common", + columnProp: 'valueChooseFlag', + headerAlign: "center", + align: "left", + columnLabel: '是否值可选', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100, + }, ], levelList:[], chooseModalData:{ diff --git a/src/views/modules/eam/eamPropertiesModel.vue b/src/views/modules/eam/eamPropertiesModel.vue index d0dc21e..70b63d5 100644 --- a/src/views/modules/eam/eamPropertiesModel.vue +++ b/src/views/modules/eam/eamPropertiesModel.vue @@ -49,10 +49,11 @@ fixed="right" header-align="center" align="center" - width="100" + width="160" label="操作"> @@ -66,7 +67,7 @@ :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> - + @@ -89,7 +90,18 @@ - + + + + + + + + + + 新增 + + @@ -129,7 +142,23 @@ - + + + + 点检项目编码 + + + + + + + + 保存 + 关闭 + + + + @@ -154,7 +183,11 @@ label="属性值"> + + 关闭 + + @@ -165,12 +198,19 @@ eamPropertiesModelEdit, eamPropertiesModelDelete, searchItemAvailable, + searchModalDetails, + saveModalDetails, + deleteModalDetails, + eamPropertiesItemSearch, } from "@/api/eam/eam.js" + import Chooselist from '@/views/modules/common/Chooselist_eam' export default { - + components: { + Chooselist + }, data () { return { - + tagNo:'', searchData: { codeNo: '', codeDesc: '', @@ -183,7 +223,7 @@ pageIndex: 1, pageSize: 100, totalPage: 0, - + addDetailModalFlag:false, modalFlag:false, modalDisableFlag:false, modalData:{ @@ -194,7 +234,15 @@ functionType:'A', userId:this.$store.state.user.name }, - + detailData:{ + codeNo:'', + codeDesc:'', + functionType:'A', + itemNo:'', + itemDesc:'', + itemType:'A', + userId:this.$store.state.user.name + }, columnList: [ { userId: this.$store.state.user.name, @@ -288,7 +336,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100, + columnWidth: 90, }, { userId: this.$store.state.user.name, @@ -306,7 +354,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 140, + columnWidth: 90, }, { userId: this.$store.state.user.name, @@ -324,7 +372,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 140, + columnWidth: 120, }, { userId: this.$store.state.user.name, @@ -342,7 +390,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100, + columnWidth: 70, }, { userId: this.$store.state.user.name, @@ -360,7 +408,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100, + columnWidth: 70, }, { userId: this.$store.state.user.name, @@ -378,7 +426,7 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100, + columnWidth: 70, }, { userId: this.$store.state.user.name, @@ -396,7 +444,25 @@ sortLv: 0, status: true, fixed: '', - columnWidth: 100, + columnWidth: 70, + }, + { + userId: this.$store.state.user.name, + functionId: 101009, + serialNumber: '101009TableValueChooseFlag', + tableId: "101009Table", + tableName: "common", + columnProp: 'valueChooseFlag', + headerAlign: "center", + align: "left", + columnLabel: '是否值可选', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 70, }, ], levelList:[], @@ -417,6 +483,24 @@ this.getDataList(); }, methods: { + // 获取基础数据列表S + getBaseList (val,type) { + this.tagNo = val + this.$nextTick(() => { + let strVal = '' + if (val === 1024) { + strVal = this.detailData.itemNo + } + this.$refs.baseList.init(val, strVal) + }) + }, + /* 列表方法的回调 */ + getBaseData (val) { + if (this.tagNo === 1024) { + this.detailData.itemNo = val.ItemNo + this.detailData.itemDesc = val.ItemDesc + } + }, // 获取数据列表 getDataList () { this.searchData.limit = this.pageSize @@ -550,7 +634,89 @@ }) } }, + //打开项目清单 + detailModal(row){ + this.detailData.codeNo=row.codeNo + this.detailData.codeDesc=row.codeDesc + searchModalDetails(this.detailData).then(({data}) => { + this.detailList = data.rows + }) + this.detailModelFlag=true; + }, + + addDetailModal(){ + this.detailData.itemNo=''; + this.detailData.itemDesc=''; + this.addDetailModalFlag=true; + }, + //保存项目明细 + saveModalDetails(){ + if(this.detailData.itemNo==""||this.detailData.itemNo==null){ + this.$alert('请选择点检项目编码!', '错误', { + confirmButtonText: '确定' + }) + return false + } + saveModalDetails(this.detailData).then(({data}) => { + if (data && data.code === 0) { + searchModalDetails(this.detailData).then(({data}) => { + this.detailList = data.rows + }) + this.addDetailModalFlag=false; + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + itemNoBlur(){ + let inData={ + itemType:'A', + itemNo:this.detailData.itemNo + } + eamPropertiesItemSearch(inData).then(({data}) => { + if(data.rows.length>0){ + this.detailData.itemDesc=data.rows[0].itemDesc + } + }) + }, + deleteModalDetails(row){ + this.$confirm(`是否删除这个点检项目?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + deleteModalDetails(row).then(({data}) => { + if (data && data.code === 0) { + searchModalDetails(this.detailData).then(({data}) => { + this.detailList = data.rows + }) + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, chooseModal(row){ this.chooseModalData.itemNo=row.itemNo;