From 52190152691bc217844d4f87b700274c297b104e Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期四, 25 七月 2024 09:55:53 +0800 Subject: [PATCH] 设备管理修改 --- src/views/eam/ABC/modules/StreamForm.vue | 795 +++++++++++++++++++++++++++++--------------------------- 1 files changed, 412 insertions(+), 383 deletions(-) diff --git a/src/views/eam/ABC/modules/StreamForm.vue b/src/views/eam/ABC/modules/StreamForm.vue index dd1e9cf..75192cb 100644 --- a/src/views/eam/ABC/modules/StreamForm.vue +++ b/src/views/eam/ABC/modules/StreamForm.vue @@ -2,11 +2,25 @@ <a-spin :spinning="confirmLoading"> <j-form-container :disabled="formDisabled"> <!-- 涓昏〃鍗曞尯鍩� --> - <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-form-model + ref="form" + :model="model" + :rules="validatorRules" + slot="detail" + > <a-row :gutter="24"> - <a-col :span="12" > - <a-form-model-item label="鍗曟嵁鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> - <a-input v-model="model.num" placeholder="绯荤粺鑷姩鐢熸垚" :disabled="true" ></a-input> + <a-col :span="12"> + <a-form-model-item + label="鍗曟嵁鍙�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="num" + > + <a-input + v-model="model.num" + placeholder="绯荤粺鑷姩鐢熸垚" + :disabled="true" + ></a-input> </a-form-model-item> </a-col> <a-col :span="12"> @@ -144,9 +158,16 @@ </a-row> </a-form-model> </j-form-container> - <!-- 瀛愯〃鍗曞尯鍩� --> - <a-tabs v-model="activeKey" @change="handleChangeTabs"> - <a-tab-pane tab="ABC璇勪环" :key="refKeys[0]" :forceRender="true"> + <!-- 瀛愯〃鍗曞尯鍩� --> + <a-tabs + v-model="activeKey" + @change="handleChangeTabs" + > + <a-tab-pane + tab="ABC璇勪环" + :key="refKeys[0]" + :forceRender="true" + > <j-vxe-table keep-source :ref="refKeys[0]" @@ -161,325 +182,332 @@ :alwaysEdit="true" @valueChange="changeDate" :toolbarConfig="toolbarConfig" - > - <template slot="toolbarPrefix"> - <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">閫夋嫨璁惧 - </a-button> - </template> + > + <template slot="toolbarPrefix"> + <a-button + type="primary" + @click="selectEquipmentList" + :disabled="formDisabled" + >閫夋嫨璁惧 + </a-button> + </template> </j-vxe-table> </a-tab-pane> </a-tabs> - <equipment-select-model ref="EquipmentSelectModal" @selectionRows="addSelectedEquipments"></equipment-select-model> + <equipment-select-model + ref="EquipmentSelectModal" + @selectionRows="addSelectedEquipments" + ></equipment-select-model> </a-spin> </template> <script> - import { getAction } from '@/api/manage' - import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' - import { JVXETypes } from '@/components/jeecg/JVxeTable' - import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' - import { validateDuplicateValue } from '@/utils/util' - import JFormContainer from '@/components/jeecg/JFormContainer' - import EquipmentSelectModel from './EquipmentSelectModel' +import { getAction } from '@/api/manage' +import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' +import { JVXETypes } from '@/components/jeecg/JVxeTable' +import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' +import { validateDuplicateValue } from '@/utils/util' +import JFormContainer from '@/components/jeecg/JFormContainer' +import EquipmentSelectModel from './EquipmentSelectModel' - export default { - name: 'StreamForm', - mixins: [JVxeTableModelMixin], - components: { - JFormContainer, - EquipmentSelectModel - }, - data() { - return { - toolbarConfig: { +export default { + name: 'StreamForm', + mixins: [JVxeTableModelMixin], + components: { + JFormContainer, + EquipmentSelectModel + }, + data() { + return { + toolbarConfig: { // prefix 鍓嶇紑锛泂uffix 鍚庣紑 slot: ['prefix', 'suffix'], // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 btn: ['remove', 'clearSelection'] - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - model:{ - }, - // 鏂板鏃跺瓙琛ㄩ粯璁ゆ坊鍔犲嚑琛岀┖鏁版嵁 - addDefaultRowNum: 0, - validatorRules: { - }, - refKeys: ['aBCAssessment' ], - tableKeys:[ 'aBCAssessment' ], - activeKey: 'streamOperation', - // ABC璇勪环 - aBCAssessmentTable: { - loading: false, - dataSource: [], - columns: [ - { - title: '缁熶竴缂栫爜', - key: 'num', - type: JVXETypes.normal, - width:"160px", - placeholder: '璇疯緭鍏�${title}', - disabled:true, - align:'center', - defaultValue:'', - }, - { - title: '璁惧鍚嶇О', - key: 'name', - type: JVXETypes.normal, - width:"160px", - placeholder: '璇疯緭鍏�${title}', - disabled:true, - align:'center', - defaultValue:'', - }, - { - title: '璁惧鍨嬪彿', - key: 'model', - type: JVXETypes.normal, - width:"160px", - placeholder: '璇疯緭鍏�${title}', - disabled:true, - align:'center', - defaultValue:'', - }, - { - title: '璁惧ID', - key: 'equipmentId', - type: JVXETypes.hidden, - width:"250px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - align:'center', - }, - { - title: '骞冲潎浣跨敤鐜�', - key: 'standardA', - type: JVXETypes.select, - width:"180px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standardA', - options:[], - align:'center', - // validateRules: [ - // { - // required: true, // 蹇呭~ - // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - // }, - // ] - }, - { - title: '鍙浛鎹㈡��', - key: 'standardB', - type: JVXETypes.select, - width:"180px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standardB', - options:[], - align:'center', - // validateRules: [ - // { - // required: true, // 蹇呭~ - // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - // }, - // ] - }, - { - title: '鏁呴殰褰卞搷搴�', - key: 'standardC', - type: JVXETypes.select, - width:"230px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standardC', - options:[], - align:'center', - // validateRules: [ - // { - // required: true, // 蹇呭~ - // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - // }, - // ] - }, - { - title: '鐢熶骇瓒呭樊搴�', - key: 'standardD', - type: JVXETypes.select, - width:"180px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standardD', - options:[], - align:'center', - // validateRules: [ - // { - // required: true, // 蹇呭~ - // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - // }, - // ] - }, - { - title: '鏁呴殰棰戠巼', - key: 'standardE', - type: JVXETypes.select, - width:"180px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standardE', - options:[], - align:'center', - // validateRules: [ - // { - // required: true, // 蹇呭~ - // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - // }, - // ] - }, - { - title: '璁惧浠峰��', - key: 'standardF', - type: JVXETypes.select, - width:"180px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standardF', - options:[], - align:'center', - // validateRules: [ - // { - // required: true, // 蹇呭~ - // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - // }, - // ] - }, - { - title: '鏃ф爣璇�', - key: 'oldStandard', - type: JVXETypes.select, - width:"180px", - disabled:true, - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standard-result', - options:[], - align:'center', - }, - { - title: '鏂版爣璇�', - key: 'finalStandard', - type: JVXETypes.select, - width:"180px", - placeholder: '璇疯緭鍏�${title}', - defaultValue:'', - dictCode:'ABC-standard-result', - options:[], - align:'center', - validateRules: [ - { - required: true, // 蹇呭~ - message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� - }, - ] - }, - ] - }, - url: { - add: "/eam/stream/add", - edit: "/eam/stream/edit", - queryById: "/eam/stream/queryById", - getNum:'/eam/sysIdentity/getNumNew', - aBCAssessment: { - list: '/eam/stream/queryABCAssessmentByMainId' + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + model: { + }, + // 鏂板鏃跺瓙琛ㄩ粯璁ゆ坊鍔犲嚑琛岀┖鏁版嵁 + addDefaultRowNum: 0, + validatorRules: { + }, + refKeys: ['aBCAssessment'], + tableKeys: ['aBCAssessment'], + activeKey: 'streamOperation', + // ABC璇勪环 + aBCAssessmentTable: { + loading: false, + dataSource: [], + columns: [ + { + title: '缁熶竴缂栫爜', + key: 'num', + type: JVXETypes.normal, + width: "160px", + placeholder: '璇疯緭鍏�${title}', + disabled: true, + align: 'center', + defaultValue: '', }, - } - } - }, - props: { - //琛ㄥ崟绂佺敤 - disabled: { - type: Boolean, - default: false, - required: false - } - }, - computed: { - formDisabled(){ - return this.disabled + { + title: '璁惧鍚嶇О', + key: 'name', + type: JVXETypes.normal, + width: "160px", + placeholder: '璇疯緭鍏�${title}', + disabled: true, + align: 'center', + defaultValue: '', + }, + { + title: '璁惧鍨嬪彿', + key: 'model', + type: JVXETypes.normal, + width: "160px", + placeholder: '璇疯緭鍏�${title}', + disabled: true, + align: 'center', + defaultValue: '', + }, + { + title: '璁惧ID', + key: 'equipmentId', + type: JVXETypes.hidden, + width: "250px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + align: 'center', + }, + { + title: '骞冲潎浣跨敤鐜�', + key: 'standardA', + type: JVXETypes.select, + width: "180px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standardA', + options: [], + align: 'center', + // validateRules: [ + // { + // required: true, // 蹇呭~ + // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + // }, + // ] + }, + { + title: '鍙浛鎹㈡��', + key: 'standardB', + type: JVXETypes.select, + width: "180px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standardB', + options: [], + align: 'center', + // validateRules: [ + // { + // required: true, // 蹇呭~ + // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + // }, + // ] + }, + { + title: '鏁呴殰褰卞搷搴�', + key: 'standardC', + type: JVXETypes.select, + width: "230px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standardC', + options: [], + align: 'center', + // validateRules: [ + // { + // required: true, // 蹇呭~ + // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + // }, + // ] + }, + { + title: '鐢熶骇瓒呭樊搴�', + key: 'standardD', + type: JVXETypes.select, + width: "180px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standardD', + options: [], + align: 'center', + // validateRules: [ + // { + // required: true, // 蹇呭~ + // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + // }, + // ] + }, + { + title: '鏁呴殰棰戠巼', + key: 'standardE', + type: JVXETypes.select, + width: "180px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standardE', + options: [], + align: 'center', + // validateRules: [ + // { + // required: true, // 蹇呭~ + // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + // }, + // ] + }, + { + title: '璁惧浠峰��', + key: 'standardF', + type: JVXETypes.select, + width: "180px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standardF', + options: [], + align: 'center', + // validateRules: [ + // { + // required: true, // 蹇呭~ + // message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + // }, + // ] + }, + { + title: '鏃ф爣璇�', + key: 'oldStandard', + type: JVXETypes.select, + width: "180px", + disabled: true, + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standard-result', + options: [], + align: 'center', + }, + { + title: '鏂版爣璇�', + key: 'finalStandard', + type: JVXETypes.select, + width: "180px", + placeholder: '璇疯緭鍏�${title}', + defaultValue: '', + dictCode: 'ABC-standard-result', + options: [], + align: 'center', + validateRules: [ + { + required: true, // 蹇呭~ + message: '璇疯緭鍏�${title}' // 鏄剧ず鐨勬枃鏈� + }, + ] + }, + ] }, - }, - created () { - }, - methods: { - addBefore(){ - let that = this; - let param = { - type: 'ABCAssement', - length: 4 - }; - getAction(this.url.getNum,param).then(res=>{ - if(res.success){ - that.model.num = res.result; - } - }) - this.aBCAssessmentTable.dataSource=[] - }, - getAllTable() { - let values = this.tableKeys.map(key => getRefPromise(this, key)) - return Promise.all(values) - }, - /** 璋冪敤瀹宔dit()鏂规硶涔嬪悗浼氳嚜鍔ㄨ皟鐢ㄦ鏂规硶 */ - editAfter() { - this.$nextTick(() => { - }) - // 鍔犺浇瀛愯〃鏁版嵁 - if (this.model.id) { - let params = { id: this.model.id } - this.requestSubTableData(this.url.aBCAssessment.list, params, this.aBCAssessmentTable) - } - }, - //鏍¢獙鎵�鏈変竴瀵逛竴瀛愯〃琛ㄥ崟 - validateSubForm(allValues){ - return new Promise((resolve,reject)=>{ - Promise.all([ - ]).then(() => { - resolve(allValues) - }).catch(e => { - if (e.error === VALIDATE_FAILED) { - // 濡傛灉鏈夋湭閫氳繃琛ㄥ崟楠岃瘉鐨勫瓙琛紝灏辫嚜鍔ㄨ烦杞埌瀹冩墍鍦ㄧ殑tab - this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] - } else { - console.error(e) - } - }) - }) + url: { + add: "/eam/stream/add", + edit: "/eam/stream/edit", + queryById: "/eam/stream/queryById", + getNum: '/eam/sysIdentity/getNumNew', + aBCAssessment: { + list: '/eam/stream/queryABCAssessmentByMainId' }, - /** 鏁寸悊鎴恌ormData */ - classifyIntoFormData(allValues) { - let main = Object.assign(this.model, allValues.formValue) - return { - ...main, // 灞曞紑 - assessmentList: allValues.tablesValue[0].tableData + } + } + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + computed: { + formDisabled() { + return this.disabled + }, + }, + created() { + }, + methods: { + addBefore() { + let that = this; + let param = { + type: 'ABCAssement', + length: 4 + }; + getAction(this.url.getNum, param).then(res => { + if (res.success) { + that.model.num = res.result; } - }, - validateError(msg){ - this.$message.error(msg) - }, - standardResultCompute(e,index) { - let keyIndex = 'standard'+index; - let tableData =this.$refs.aBCAssessment.getTableData(); - for(var i = 0;i<tableData.length;i++){ - let row = this.$refs.aBCAssessment.getRowById(tableData[i].equipmentId); - row[keyIndex]=e - this.changeDateByRow(row); + }) + this.aBCAssessmentTable.dataSource = [] + }, + getAllTable() { + let values = this.tableKeys.map(key => getRefPromise(this, key)) + return Promise.all(values) + }, + /** 璋冪敤瀹宔dit()鏂规硶涔嬪悗浼氳嚜鍔ㄨ皟鐢ㄦ鏂规硶 */ + editAfter() { + this.$nextTick(() => { + }) + // 鍔犺浇瀛愯〃鏁版嵁 + if (this.model.id) { + let params = { id: this.model.id } + this.requestSubTableData(this.url.aBCAssessment.list, params, this.aBCAssessmentTable) + } + }, + //鏍¢獙鎵�鏈変竴瀵逛竴瀛愯〃琛ㄥ崟 + validateSubForm(allValues) { + return new Promise((resolve, reject) => { + Promise.all([ + ]).then(() => { + resolve(allValues) + }).catch(e => { + if (e.error === VALIDATE_FAILED) { + // 濡傛灉鏈夋湭閫氳繃琛ㄥ崟楠岃瘉鐨勫瓙琛紝灏辫嚜鍔ㄨ烦杞埌瀹冩墍鍦ㄧ殑tab + this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] + } else { + console.error(e) + } + }) + }) + }, + /** 鏁寸悊鎴恌ormData */ + classifyIntoFormData(allValues) { + let main = Object.assign(this.model, allValues.formValue) + return { + ...main, // 灞曞紑 + assessmentList: allValues.tablesValue[0].tableData + } + }, + validateError(msg) { + this.$message.error(msg) + }, + standardResultCompute(e, index) { + let keyIndex = 'standard' + index; + let tableData = this.$refs.aBCAssessment.getTableData(); + for (var i = 0; i < tableData.length; i++) { + let row = this.$refs.aBCAssessment.getRowById(tableData[i].equipmentId); + row[keyIndex] = e + this.changeDateByRow(row); } var standardA = this.model.standardA == null || this.model.standardA == undefined || this.model.standardA == '' ? 0 : parseInt(this.model.standardA); var standardB = this.model.standardB == null || this.model.standardB == undefined || this.model.standardB == '' ? 0 : parseInt(this.model.standardB); @@ -496,83 +524,84 @@ } else { this.model.finalStandard = 'C' } - this.model = Object.assign({}, this.model); - }, - //閫夋嫨璁惧 - selectEquipmentList() { - let ids = [] - let tableData = this.$refs.aBCAssessment.getTableData() - let deleteData = this.$refs.aBCAssessment.getDeleteData() - for (let i = 0; i < tableData.length; i++) { - ids.push(tableData[i].equipmentId) - } - this.$refs.EquipmentSelectModal.showModals(ids) - this.$refs.EquipmentSelectModal.title = '閫夋嫨璁惧' - this.$refs.EquipmentSelectModal.disableSubmit = false - }, - addSelectedEquipments(data) { - let tableData = this.$refs.aBCAssessment.getTableData() - // const seletedEquipmentIds = tableData. - var tableStr = JSON.stringify(tableData) - const addRows = [] - for (let i = 0; i < data.length; i++) { - var equipment = {} - if (tableStr.indexOf(data[i].id)==-1) { - equipment = { - id:data[i].id, - equipmentId: data[i].id, - num: data[i].num, - name: data[i].name, - model:data[i].model, - standardA:data[i].standardA, - standardB:data[i].standardB, - standardC:data[i].standardC, - standardD:data[i].standardD, - standardE:data[i].standardE, - standardF:data[i].standardF, - oldStandard:data[i].equipmentImportanceId, - finalStandard:'D', - } + this.model = Object.assign({}, this.model); + }, + //閫夋嫨璁惧 + selectEquipmentList() { + let ids = [] + let tableData = this.$refs.aBCAssessment.getTableData() + let deleteData = this.$refs.aBCAssessment.getDeleteData() + for (let i = 0; i < tableData.length; i++) { + ids.push(tableData[i].equipmentId) + } + this.$refs.EquipmentSelectModal.showModals(ids) + this.$refs.EquipmentSelectModal.title = '閫夋嫨璁惧' + this.$refs.EquipmentSelectModal.disableSubmit = false + }, + addSelectedEquipments(data) { + let tableData = this.$refs.aBCAssessment.getTableData() + debugger + // const seletedEquipmentIds = tableData. + var tableStr = JSON.stringify(tableData) + const addRows = [] + for (let i = 0; i < data.length; i++) { + var equipment = {} + if (tableStr.indexOf(data[i].id) == -1) { + equipment = { + id: data[i].id, + equipmentId: data[i].id, + num: data[i].num, + name: data[i].name, + model: data[i].model, + standardA: data[i].standardA, + standardB: data[i].standardB, + standardC: data[i].standardC, + standardD: data[i].standardD, + standardE: data[i].standardE, + standardF: data[i].standardF, + oldStandard: data[i].equipmentImportanceId, + finalStandard: 'D', } - addRows.push(equipment) } - this.$refs.aBCAssessment.pushRows(addRows) - }, - changeDate(target){ - var standardA = target.row.standardA == null || target.row.standardA == undefined || target.row.standardA == '' ? 0 : parseInt(target.row.standardA); - var standardB = target.row.standardB == null || target.row.standardB == undefined || target.row.standardB == '' ? 0 : parseInt(target.row.standardB); - var standardC = target.row.standardC == null || target.row.standardC == undefined || target.row.standardC == '' ? 0 : parseInt(target.row.standardC); - var standardD = target.row.standardD == null || target.row.standardD == undefined || target.row.standardD == '' ? 0 : parseInt(target.row.standardD); - var standardE = target.row.standardE == null || target.row.standardE == undefined || target.row.standardE == '' ? 0 : parseInt(target.row.standardE); - var standardF = target.row.standardF == null || target.row.standardF == undefined || target.row.standardF == '' ? 0 : parseInt(target.row.standardF); - var sum = standardA + standardB + standardC + standardD + standardE + standardF; - console.log(target) - if (sum >= 18) { - target.row.finalStandard = 'A' - } else if (sum >= 10 && sum <= 17) { - target.row.finalStandard = 'B' - } else { - target.row.finalStandard = 'C' - } - }, - changeDateByRow(row){ - var standardA = row.standardA == null || row.standardA == undefined || row.standardA == '' ? 0 : parseInt(row.standardA); - var standardB = row.standardB == null || row.standardB == undefined || row.standardB == '' ? 0 : parseInt(row.standardB); - var standardC = row.standardC == null || row.standardC == undefined || row.standardC == '' ? 0 : parseInt(row.standardC); - var standardD = row.standardD == null || row.standardD == undefined || row.standardD == '' ? 0 : parseInt(row.standardD); - var standardE = row.standardE == null || row.standardE == undefined || row.standardE == '' ? 0 : parseInt(row.standardE); - var standardF = row.standardF == null || row.standardF == undefined || row.standardF == '' ? 0 : parseInt(row.standardF); - var sum = standardA + standardB + standardC + standardD + standardE + standardF; - if (sum >= 18) { - row.finalStandard = 'A' - } else if (sum >= 10 && sum <= 17) { - row.finalStandard = 'B' - } else { - row.finalStandard = 'C' - } - }, - } + addRows.push(equipment) + } + this.$refs.aBCAssessment.pushRows(addRows) + }, + changeDate(target) { + var standardA = target.row.standardA == null || target.row.standardA == undefined || target.row.standardA == '' ? 0 : parseInt(target.row.standardA); + var standardB = target.row.standardB == null || target.row.standardB == undefined || target.row.standardB == '' ? 0 : parseInt(target.row.standardB); + var standardC = target.row.standardC == null || target.row.standardC == undefined || target.row.standardC == '' ? 0 : parseInt(target.row.standardC); + var standardD = target.row.standardD == null || target.row.standardD == undefined || target.row.standardD == '' ? 0 : parseInt(target.row.standardD); + var standardE = target.row.standardE == null || target.row.standardE == undefined || target.row.standardE == '' ? 0 : parseInt(target.row.standardE); + var standardF = target.row.standardF == null || target.row.standardF == undefined || target.row.standardF == '' ? 0 : parseInt(target.row.standardF); + var sum = standardA + standardB + standardC + standardD + standardE + standardF; + console.log(target) + if (sum >= 18) { + target.row.finalStandard = 'A' + } else if (sum >= 10 && sum <= 17) { + target.row.finalStandard = 'B' + } else { + target.row.finalStandard = 'C' + } + }, + changeDateByRow(row) { + var standardA = row.standardA == null || row.standardA == undefined || row.standardA == '' ? 0 : parseInt(row.standardA); + var standardB = row.standardB == null || row.standardB == undefined || row.standardB == '' ? 0 : parseInt(row.standardB); + var standardC = row.standardC == null || row.standardC == undefined || row.standardC == '' ? 0 : parseInt(row.standardC); + var standardD = row.standardD == null || row.standardD == undefined || row.standardD == '' ? 0 : parseInt(row.standardD); + var standardE = row.standardE == null || row.standardE == undefined || row.standardE == '' ? 0 : parseInt(row.standardE); + var standardF = row.standardF == null || row.standardF == undefined || row.standardF == '' ? 0 : parseInt(row.standardF); + var sum = standardA + standardB + standardC + standardD + standardE + standardF; + if (sum >= 18) { + row.finalStandard = 'A' + } else if (sum >= 10 && sum <= 17) { + row.finalStandard = 'B' + } else { + row.finalStandard = 'C' + } + }, } +} </script> <style scoped> -- Gitblit v1.9.3