| | |
| | | item.indexOf('模具编码')!==-1|| |
| | | item.indexOf('产品编码')!==-1|| |
| | | |
| | | item.indexOf('标准编号')!==-1|| |
| | | item.indexOf('项序号')!==-1|| |
| | | item.indexOf('项要求')!==-1|| |
| | | |
| | | item.indexOf('计量单位/组名称')!==-1 |
| | | " |
| | | > |
| | |
| | | j.uuid = nanoid() |
| | | }) |
| | | } |
| | | |
| | | if (this.sheetName.indexOf('模具点检标准') !== -1) { |
| | | // this.statusArr = [ |
| | | // { code: 'Y', name: '正常' }, |
| | | // { code: 'N', name: '故障' } |
| | | // ] |
| | | |
| | | this.tableData[0].forEach(j => { |
| | | j.uuid = nanoid() |
| | | // j['*状态'] = j['*状态'] ? this.statusArr.find(e => e.name === j['*状态']).code : '' |
| | | }) |
| | | this.tableData[1].forEach(j => { |
| | | j.uuid = nanoid() |
| | | }) |
| | | } |
| | | }, |
| | | // 提交 |
| | | submit() { |
| | |
| | | |
| | | if (this.sheetName.indexOf('模具点检项目') !== -1) { |
| | | const res = this.handleMouldCheckPosSubmitData() |
| | | if (res.code !== '200') { |
| | | return this.$message.info(res.message) |
| | | } |
| | | } |
| | | |
| | | if (this.sheetName.indexOf('模具点检标准') !== -1) { |
| | | const res = this.handleMouldCheckStandSubmitData() |
| | | if (res.code !== '200') { |
| | | return this.$message.info(res.message) |
| | | } |
| | | } |
| | | |
| | | if (this.sheetName.indexOf('模具保养项目') !== -1) { |
| | | const res = this.handleMouldMaintainSubmitData() |
| | | if (res.code !== '200') { |
| | | return this.$message.info(res.message) |
| | | } |
| | | } |
| | | |
| | | if (this.sheetName.indexOf('模具保养标准') !== -1) { |
| | | const res = this.handleMouldMaintainStandSubmitData() |
| | | if (res.code !== '200') { |
| | | return this.$message.info(res.message) |
| | | } |
| | |
| | | |
| | | return { code: '200', message: '成功!' } |
| | | }, |
| | | // 处理模具点检标准提交数据 |
| | | handleMouldCheckStandSubmitData() { |
| | | let flag = true |
| | | let msg = '' |
| | | if ([...new Set(this.tableData[0].map(i => i['*模具点检标准编号(唯一)']))].length !== this.tableData[0].length) { |
| | | return this.$message.info('点检标准编号不能重复!') |
| | | } |
| | | if ([...new Set(this.tableData[1].map(i => i['*模具点检标准编号']))].length !== this.tableData[1].length) { |
| | | return this.$message.info('模具点检标准编号不能重复!') |
| | | } |
| | | this.tableData[0].forEach(j => { |
| | | if (!j['*模具点检标准编号(唯一)']) { |
| | | flag = false |
| | | msg = '*模具点检标准编号(唯一)不能为空!' |
| | | } |
| | | if (!j['*模具点检标准名称']) { |
| | | flag = false |
| | | msg = '*模具点检标准不能为空!' |
| | | } |
| | | }) |
| | | this.tableData[1].forEach(j => { |
| | | if (!j['*模具点检标准编号']) { |
| | | flag = false |
| | | msg = '*模具点检标准编号不能为空!' |
| | | } |
| | | if (!j['*点检项序号']) { |
| | | flag = false |
| | | msg = '*点检项序号不能为空!' |
| | | } |
| | | if (!j['*模具点检项编号(唯一)']) { |
| | | flag = false |
| | | msg = '*模具点检项编号(唯一)不能为空!' |
| | | } |
| | | if (!j['*模具点检项名称']) { |
| | | flag = false |
| | | msg = '*模具点检项名称不能为空!' |
| | | } |
| | | }) |
| | | |
| | | if (!flag) { |
| | | return { code: '301', message: msg } |
| | | } |
| | | |
| | | this.tableData[0].map(item => { |
| | | delete (item.uuid) |
| | | }) |
| | | this.tableData[1].map(item => { |
| | | delete (item.uuid) |
| | | }) |
| | | |
| | | return { code: '200', message: '成功!' } |
| | | }, |
| | | // 处理模具保养项目提交数据 |
| | | handleMouldMaintainSubmitData() { |
| | | let flag = true |
| | | let msg = '' |
| | | if ([...new Set(this.tableData[0].map(i => i['*保养项目编号(唯一)']))].length !== this.tableData[0].length) { |
| | | return this.$message.info('编码不能重复!') |
| | | } |
| | | this.tableData[0].forEach(j => { |
| | | if (!j['*保养项目编号(唯一)']) { |
| | | flag = false |
| | | msg = '*保养项目编号(唯一)' |
| | | } |
| | | if (!j['*保养项目名称']) { |
| | | flag = false |
| | | msg = '*保养项目名称' |
| | | } |
| | | }) |
| | | |
| | | if (!flag) { |
| | | return { code: '301', message: msg + '不能为空!' } |
| | | } |
| | | |
| | | this.tableData[0].map(item => { |
| | | delete (item.uuid) |
| | | }) |
| | | |
| | | return { code: '200', message: '成功!' } |
| | | }, |
| | | // 处理模具保养标准提交数据 |
| | | handleMouldMaintainStandSubmitData() { |
| | | let flag = true |
| | | let msg = '' |
| | | if ([...new Set(this.tableData[0].map(i => i['*模具保养标准编号(唯一)']))].length !== this.tableData[0].length) { |
| | | return this.$message.info('保养标准编号不能重复!') |
| | | } |
| | | if ([...new Set(this.tableData[1].map(i => i['*模具保养标准编号']))].length !== this.tableData[1].length) { |
| | | return this.$message.info('模具保养标准编号不能重复!') |
| | | } |
| | | this.tableData[0].forEach(j => { |
| | | if (!j['*模具保养标准编号(唯一)']) { |
| | | flag = false |
| | | msg = '*模具保养标准编号(唯一)不能为空!' |
| | | } |
| | | if (!j['*模具保养标准名称']) { |
| | | flag = false |
| | | msg = '*模具保养标准不能为空!' |
| | | } |
| | | }) |
| | | this.tableData[1].forEach(j => { |
| | | if (!j['*模具保养标准编号']) { |
| | | flag = false |
| | | msg = '*模具保养标准编号不能为空!' |
| | | } |
| | | if (!j['*保养项序号']) { |
| | | flag = false |
| | | msg = '*保养项序号不能为空!' |
| | | } |
| | | if (!j['*模具保养项编号(唯一)']) { |
| | | flag = false |
| | | msg = '*模具保养项编号(唯一)不能为空!' |
| | | } |
| | | if (!j['*模具保养项名称']) { |
| | | flag = false |
| | | msg = '*模具保养项名称不能为空!' |
| | | } |
| | | }) |
| | | |
| | | if (!flag) { |
| | | return { code: '301', message: msg } |
| | | } |
| | | |
| | | this.tableData[0].map(item => { |
| | | delete (item.uuid) |
| | | }) |
| | | this.tableData[1].map(item => { |
| | | delete (item.uuid) |
| | | }) |
| | | |
| | | return { code: '200', message: '成功!' } |
| | | }, |
| | | |
| | | // parents:用于返回的数组,childNode:要查询的节点,treeData:json树形数据 |
| | | findParent(parents, childNode, treeData) { |
| | |
| | | '要求描述': '' |
| | | }) |
| | | } |
| | | |
| | | // 模具点检标准 |
| | | if (this.sheetName.indexOf('模具点检标准') !== -1 && this.activeName === '0') { |
| | | this.tableData[0].unshift({ |
| | | uuid: nanoid(), |
| | | '*模具点检标准编号(唯一)': '', |
| | | '*模具点检标准名称': '', |
| | | '标准描述': '' |
| | | }) |
| | | } |
| | | if (this.sheetName.indexOf('关联模具点检部位') !== -1 && this.activeName === '1') { |
| | | this.tableData[1].unshift({ |
| | | uuid: nanoid(), |
| | | '*模具点检标准编号': '', |
| | | '*点检项序号': '', |
| | | '*模具点检项编号(唯一)': '', |
| | | '*模具点检项名称': '', |
| | | '点检项要求': '' |
| | | }) |
| | | } |
| | | |
| | | // 模具保养项 |
| | | if (this.sheetName.indexOf('模具保养项目') !== -1) { |
| | | this.tableData[0].unshift({ |
| | | uuid: nanoid(), |
| | | '*保养项目编号(唯一)': '', |
| | | '*保养项目名称': '', |
| | | '要求描述': '' |
| | | }) |
| | | } |
| | | |
| | | // 模具保养标准 |
| | | if (this.sheetName.indexOf('模具保养标准') !== -1 && this.activeName === '0') { |
| | | this.tableData[0].unshift({ |
| | | uuid: nanoid(), |
| | | '*模具保养标准编号(唯一)': '', |
| | | '*模具保养标准名称': '', |
| | | '标准描述': '' |
| | | }) |
| | | } |
| | | if (this.sheetName.indexOf('关联模具保养部位') !== -1 && this.activeName === '1') { |
| | | this.tableData[1].unshift({ |
| | | uuid: nanoid(), |
| | | '*模具保养标准编号': '', |
| | | '*保养项序号': '', |
| | | '*模具保养项编号(唯一)': '', |
| | | '*模具保养项名称': '', |
| | | '保养项要求': '' |
| | | }) |
| | | } |
| | | }, |
| | | delRow(row) { |
| | | // 针对单sheet |