diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index 4afd1f8..b526f75 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -142,6 +142,8 @@ export const queryResourceList = data => createAPI(`/pms/pqc/queryResourceList`, export const queryOperationResourceList = data => createAPI(`/pms/pqc/queryOperationResourceList`,'post',data) export const queryEamObjectlist = data => createAPI(`/pms/pqc/queryEamObjectlist`,'post',data) export const deleteOperationForResource = data => createAPI(`/pms/pqc/deleteOperationForResource`,'post',data) +export const deleteOperationForResource2 = data => createAPI(`/pms/pqc/deleteOperationForResource2`,'post',data) +export const getResourceDataOperationForResource = data => createAPI(`/pms/pqc/getResourceDataOperationForResource`,'post',data) export const deleteUserDefaultOperation = data => createAPI(`/pms/pqc/deleteUserDefaultOperation`,'post',data) export const getHuanXianSysUserList = data => createAPI(`/pms/pqc/getHuanXianSysUserList`,'post',data) export const getAllUserList = data => createAPI(`/pms/pqc/getAllUserList`,'post',data) diff --git a/src/views/modules/qc/OperationForResource.vue b/src/views/modules/qc/OperationForResource.vue index 25efc56..eddf2c8 100644 --- a/src/views/modules/qc/OperationForResource.vue +++ b/src/views/modules/qc/OperationForResource.vue @@ -4,6 +4,8 @@ import {queryOperationForResourceList, queytOperationList, queryResourceList, deleteOperationForResource, + deleteOperationForResource2, + getResourceDataOperationForResource, getSiteAndBuByUserName, queryResourceList2 } from "@/api/qc/qc.js" @@ -20,9 +22,17 @@ export default { resource: '' }, dataList: [], + resourceDataList: [], total: 0, modalFlag: false, resourceFlag:false, + resourceDataFlag:false, + addResourceDataFlag:false, + resourceData:{ + buDesc:'', + operation:'', + operationDesc:'' + }, ifexist:0, resourData:{ resourceId:'', @@ -92,42 +102,42 @@ export default { fixed: '', columnWidth: 80 }, - { - userId: this.$store.state.user.name, - functionId: 200101107, - serialNumber: '200101107Table1Resource', - tableId: '200101107Table1', - tableName: '用户默认工序设置表', - columnProp: 'resource', - headerAlign: 'center', - align: 'center', - columnLabel: '机台编码', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 200101107, - serialNumber: '200101107Table1Resource', - tableId: '200101107Table1', - tableName: '用户默认工序设置表', - columnProp: 'resourceDesc', - headerAlign: 'center', - align: 'center', - columnLabel: '机台名称', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - } + // { + // userId: this.$store.state.user.name, + // functionId: 200101107, + // serialNumber: '200101107Table1Resource', + // tableId: '200101107Table1', + // tableName: '用户默认工序设置表', + // columnProp: 'resource', + // headerAlign: 'center', + // align: 'center', + // columnLabel: '机台编码', + // columnHidden: false, + // columnImage: false, + // columnSortable: false, + // sortLv: 0, + // status: true, + // fixed: '', + // columnWidth: 80 + // }, + // { + // userId: this.$store.state.user.name, + // functionId: 200101107, + // serialNumber: '200101107Table1Resource', + // tableId: '200101107Table1', + // tableName: '用户默认工序设置表', + // columnProp: 'resourceDesc', + // headerAlign: 'center', + // align: 'center', + // columnLabel: '机台名称', + // columnHidden: false, + // columnImage: false, + // columnSortable: false, + // sortLv: 0, + // status: true, + // fixed: '', + // columnWidth: 80 + // } ], resourceColomn: [ { @@ -199,10 +209,26 @@ export default { resource: '', operation:'' } + this.addResourceDataFlag = false + this.modalFlag = true + }, + addResourceData(){ + this.addResourceDataFlag = true + this.modalData = { + page: 1, + pageCount: 50, + resource: '', + bu: this.resourceData.bu, + operation: this.resourceData.operation + } this.modalFlag = true }, async saveModalData(){ this.ifexist=0 + if (this.modalData.bu==null ||this.modalData.bu==''){ + this.$message.warning("请选择BU!") + return + } if (this.modalData.operation==null ||this.modalData.operation==''){ this.$message.warning("工序类别不能为空!") return @@ -223,6 +249,17 @@ export default { saveOperationForResource(this.modalData).then(({data})=>{ if (data.code==0){ this.$message.success("保存成功") + if (this.addResourceDataFlag){ + let param = { + bu: this.resourceData.bu, + operation: this.resourceData.operation + } + getResourceDataOperationForResource(param).then(({data})=>{ + if (data && data.code==0) { + this.resourceDataList = data.rows + } + }) + } } }).catch() this.modalFlag = false @@ -258,7 +295,7 @@ export default { this.resourceFlag = false }, deleteData(row){ - this.$confirm(`确认删除?`, '提示', { + this.$confirm(`确认删除该工序及其所有机台信息?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -271,6 +308,34 @@ export default { }).catch() }) + }, + deleteData2(row){ + deleteOperationForResource2(row).then(({data})=>{ + if (data&&data.code == 0){ + this.$message.success("删除成功") + let param = { + bu: this.resourceData.bu, + operation: this.resourceData.operation + } + getResourceDataOperationForResource(param).then(({data})=>{ + if (data && data.code==0) { + this.resourceDataList = data.rows + } + }) + } + }) + }, + getResourceData(row){ + this.resourceData.bu = row.bu + this.resourceData.buDesc = row.buDesc + this.resourceData.operation = row.operation + this.resourceData.operationDesc = row.operationDesc + getResourceDataOperationForResource(row).then(({data})=>{ + if (data && data.code==0) { + this.resourceDataList = data.rows + this.resourceDataFlag = true + } + }) } }, created () { @@ -309,7 +374,7 @@ export default { - + @@ -320,11 +385,11 @@ export default {
- + - + - +
@@ -441,6 +506,48 @@ export default { + + +
+ + + + + + + + + + + + 新增 + + + + + + + + + + + +
+ + 关闭 + +
+