| | |
| | | |
| | | <!-- <a-switch @change='(e)=>onChange(e, record.key, col, index)' :value='text' :disabled="repairOrderStatus=='4'"--> |
| | | <!-- v-if="col.dataIndex == 'principalContractor'" />--> |
| | | <a-select default-value='0' :value='text' :disabled="repairOrderStatus=='4'" |
| | | v-if="col.dataIndex == 'principalContractor'" |
| | | style="width: 100%;" |
| | | @change='(e)=>handleChange(e, record.key, col, index)'> |
| | | <a-select |
| | | default-value='0' |
| | | :value='text' |
| | | :disabled="repairOrderStatus=='4'" |
| | | v-if="col.dataIndex == 'principalContractor'" |
| | | style="width: 100%;" |
| | | @change='(e)=>handleChange(e, record.key, col, index)' |
| | | > |
| | | <a-select-opt-group> |
| | | <a-select-option value='1' style="width: 100%;"> |
| | | <a-select-option |
| | | value='1' |
| | | style="width: 100%;" |
| | | > |
| | | 是 |
| | | </a-select-option> |
| | | <a-select-option value='0' style="width: 100%;"> |
| | | <a-select-option |
| | | value='0' |
| | | style="width: 100%;" |
| | | > |
| | | 否 |
| | | </a-select-option> |
| | | </a-select-opt-group> |
| | |
| | | :value='text' |
| | | format='YYYY-MM-DD HH:mm' |
| | | :show-time="{ defaultValue: moment('00:00', 'HH:mm') }" |
| | | v-if="col.dataIndex == 'startTime'" @change='(e)=>handleChange(e, record.key, col, index)' |
| | | v-if="col.dataIndex == 'startTime'" |
| | | @change='(e)=>handleChange(e, record.key, col, index)' |
| | | /> |
| | | <!-- :disabled="repairOrderStatus=='4'"--> |
| | | <a-date-picker |
| | | :value='text' |
| | | format='YYYY-MM-DD HH:mm' |
| | | :show-time="{ defaultValue: moment('00:00', 'HH:mm') }" |
| | | v-if="col.dataIndex == 'endTime'" @change='(e)=>handleChange(e, record.key, col, index)' |
| | | v-if="col.dataIndex == 'endTime'" |
| | | @change='(e)=>handleChange(e, record.key, col, index)' |
| | | /> |
| | | |
| | | <!-- <a-input-number--> |
| | |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | |
| | | repairOrderId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if(this.repairOrderId){ |
| | | if (this.repairOrderId) { |
| | | this.clearList() |
| | | this.queryParam['repairOrderId'] = val |
| | | this.loadData(1) |
| | |
| | | onChange(checked) { |
| | | console.log(`a-switch to ${checked}`) |
| | | }, |
| | | //时间选择修改 |
| | | //时间选择修改 |
| | | onStartTimeChange() { |
| | | console.log() |
| | | |
| | |
| | | } |
| | | if ('principalContractor' == column.dataIndex) { |
| | | target['principalContractor'] = value |
| | | if(value==='1'){ |
| | | for(var i = 0;i<temp.length;i++){ |
| | | if(i!==index){ |
| | | temp[i]['principalContractor']='0'; |
| | | } |
| | | if (value === '1') { |
| | | for (var i = 0; i < temp.length; i++) { |
| | | if (i !== index) { |
| | | temp[i]['principalContractor'] = '0'; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ('actualHour' == column.dataIndex) { |
| | | if(target['theoreticalTime']!==null&&target['theoreticalTime']<value){ |
| | | if (target['theoreticalTime'] !== null && target['theoreticalTime'] < value) { |
| | | that.$message.error('请检查第' + (index + 1) + '行实际工时不能小于理论工时,请重新填写') |
| | | target['actualHour']=null; |
| | | }else if(target['theoreticalTime']===null||target['theoreticalTime']===undefined){ |
| | | target['actualHour'] = null; |
| | | } else if (target['theoreticalTime'] === null || target['theoreticalTime'] === undefined) { |
| | | that.$message.error('请检查第' + (index + 1) + '请先填写开始时间与结束时间') |
| | | target['actualHour']=null; |
| | | }else{ |
| | | target['actualHour'] = null; |
| | | } else { |
| | | target['actualHour'] = value |
| | | } |
| | | |
| | | |
| | | } |
| | | // if ('theoreticalTime' == column.dataIndex) { |
| | | // target['theoreticalTime'] = value |
| | |
| | | |
| | | if (target['endTime'] == null) { |
| | | target['startTime'] = value |
| | | } else { |
| | | } else { |
| | | const diffInHours = this.getTimeDiff(value, target['endTime']) |
| | | if (diffInHours < 0) { |
| | | target['startTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('开始时间不能小于结束时间,请重新选择') |
| | | } else { |
| | | if(target['actualHour']!==null){ |
| | | if(diffInHours<target['actualHour']){ |
| | | target['startTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('实际工时不能小于理论工时,请重新填写') |
| | | }else{ |
| | | target['startTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | }else{ |
| | | if (target['actualHour'] !== null) { |
| | | if (diffInHours < target['actualHour']) { |
| | | target['startTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('实际工时不能小于理论工时,请重新填写') |
| | | } else { |
| | | target['startTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | } else { |
| | | target['startTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ('endTime' == column.dataIndex) { |
| | |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('开始时间不能小于结束时间,请重新选择') |
| | | } else { |
| | | if(target['actualHour']!==null){ |
| | | if(diffInHours<target['actualHour']){ |
| | | target['endTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('实际工时不能小于理论工时,请重新填写') |
| | | }else{ |
| | | target['endTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | }else{ |
| | | if (target['actualHour'] !== null) { |
| | | if (diffInHours < target['actualHour']) { |
| | | target['endTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('实际工时不能小于理论工时,请重新填写') |
| | | } else { |
| | | target['endTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | } else { |
| | | target['endTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |