| | |
| | | slot-scope='text, record, index' |
| | | > |
| | | <div :key='col.dataIndex'> |
| | | <a-input-search |
| | | v-if="col.dataIndex == 'username'" |
| | | enter-button |
| | | @search='onSearchUser(index)' |
| | | <a-input |
| | | v-if="col.dataIndex == 'userId'" |
| | | :value='text' |
| | | :read-only='true' |
| | | @change='(e) => handleChange(e, record.key, col, index)' |
| | | :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-opt-group> |
| | | <a-select-option value='1'> |
| | | <a-select-option value='1' style="width: 100%;"> |
| | | 是 |
| | | </a-select-option> |
| | | <a-select-option value='0'> |
| | | <a-select-option value='0' style="width: 100%;"> |
| | | 否 |
| | | </a-select-option> |
| | | </a-select-opt-group> |
| | |
| | | > |
| | | 取消 |
| | | </a-button> |
| | | <a-button |
| | | <!-- <a-button |
| | | @click='handleOk(1)' |
| | | type='primary' |
| | | :style="{marginRight: '8px'}" |
| | | :disabled="this.repairOrderStatus=='4' || this.repairOrderStatus=='2'" |
| | | >暂存 |
| | | </a-button> |
| | | </a-button> --> |
| | | <a-button |
| | | @click='handleOk(0)' |
| | | type='primary' |
| | |
| | | repairOrderId: { |
| | | type: String, |
| | | required: false, |
| | | default: '-1' |
| | | }, |
| | | repairOrderStatus: { |
| | | type: String, |
| | |
| | | validatorRules: { |
| | | userId: { |
| | | rules: [ |
| | | { required: true, message: '请选择人员!' } |
| | | { required: true, message: '请填写人员!' } |
| | | ] |
| | | }, |
| | | actual_hour: { |
| | |
| | | } |
| | | }, |
| | | { |
| | | title: '*人员编码', |
| | | dataIndex: 'username', |
| | | title: '*人员名称', |
| | | dataIndex: 'userId', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'username' }, |
| | | scopedSlots: { customRender: 'userId' }, |
| | | className: 'red', |
| | | width: 250 |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: '人员名称', |
| | | dataIndex: 'realname', |
| | | align: 'center', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: '主承修人', |
| | | title: '*主承修人', |
| | | dataIndex: 'principalContractor', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'principalContractor' }, |
| | | width: 100 |
| | | className: 'red', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: '*实际工时', |
| | |
| | | align: 'center', |
| | | className: 'red', |
| | | scopedSlots: { customRender: 'actualHour' }, |
| | | width: 120 |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: '开始时间', |
| | | dataIndex: 'startTime', |
| | | scopedSlots: { customRender: 'startTime' }, |
| | | align: 'center' |
| | | align: 'center', |
| | | width: 200 |
| | | }, |
| | | { |
| | | title: '结束时间', |
| | | dataIndex: 'endTime', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'endTime' } |
| | | scopedSlots: { customRender: 'endTime' }, |
| | | width: 200 |
| | | |
| | | }, |
| | | |
| | | { |
| | |
| | | dataIndex: 'theoreticalTime', |
| | | align: 'center' |
| | | // scopedSlots: { customRender: 'theoreticalTime' }, |
| | | , |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | width: 250, |
| | | width: 150, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | |
| | | repairOrderId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | this.clearList() |
| | | this.queryParam['repairOrderId'] = val |
| | | this.loadData(1) |
| | | if(this.repairOrderId){ |
| | | this.clearList() |
| | | this.queryParam['repairOrderId'] = val |
| | | this.loadData(1) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.disableSubmit = false |
| | | this.visible = false |
| | | }, |
| | | handleDelete(text, record, index) { |
| | | handleDelete(index) { |
| | | console.log(index) |
| | | this.dataSource.splice(index, 1) |
| | | }, |
| | | |
| | |
| | | const temp = [...that.dataSource] |
| | | const target = temp[index] |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | if ('userId' == column.dataIndex) { |
| | | target['userId'] = value |
| | | target['userId'] = value.target.value |
| | | } |
| | | 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 ('actualHour' == column.dataIndex) { |
| | |
| | | |
| | | if (target['endTime'] == null) { |
| | | target['startTime'] = value |
| | | } else if (target['startTime'] != null && target['endTime'] != null) { |
| | | const diffInHours = this.getTimeDiff(target['startTime'], target['endTime']) |
| | | if (diffInHours < 0) { |
| | | target['startTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择') |
| | | } else { |
| | | target['startTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | } else if (target['startTime'] == null && target['endTime'] != null) { |
| | | } else { |
| | | const diffInHours = this.getTimeDiff(value, target['endTime']) |
| | | if (diffInHours < 0) { |
| | | target['startTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择') |
| | | |
| | | that.$message.error('开始时间不能小于结束时间,请重新选择') |
| | | } else { |
| | | target['startTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | 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) { |
| | | if (target['startTime'] == null) { |
| | | target['endTime'] = value |
| | | } else if (target['startTime'] != null && target['endTime'] != null) { |
| | | const diffInHours = this.getTimeDiff(target['startTime'], target['endTime']) |
| | | if (diffInHours < 0) { |
| | | target['endTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择') |
| | | } else { |
| | | target['endTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | } |
| | | |
| | | } else if (target['startTime'] != null && target['endTime'] == null) { |
| | | } else { |
| | | const diffInHours = this.getTimeDiff(target['startTime'], value) |
| | | if (diffInHours < 0) { |
| | | target['endTime'] = '' |
| | | target['theoreticalTime'] = '' |
| | | that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择') |
| | | |
| | | that.$message.error('开始时间不能小于结束时间,请重新选择') |
| | | } else { |
| | | target['endTime'] = value |
| | | target['theoreticalTime'] = diffInHours |
| | | 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 |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | that.dataSource = temp |