| | |
| | | <el-form-item label="消耗工作量单位" prop="consumedWorkloadUnit"> |
| | | {{ dict.label[standardWorkloadUnit][form.consumedWorkloadUnit] }} |
| | | </el-form-item> |
| | | <el-form-item label="任务进度" prop="taskProgress"> |
| | | <el-input v-model="form.taskProgress" style="width: 340px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="结算状态" prop="settlementStatus"> |
| | | <el-select v-model="form.settlementStatus" filterable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in dict[settlementStatus]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 340px;" /> |
| | | </el-form-item> |
| | |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toDate(scope.row.fillDate) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属用户" width="100"> |
| | | <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属用户" fixed="left" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.userNickName }}</el-tag> |
| | | </template> |
| | |
| | | <el-tag>{{ scope.row.taskName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="consumedWorkload" label="消耗工作量" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" width="80" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="consumedWorkload" label="消耗工作量" width="80" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskWorkloadUnit" label="消耗工作量单位" width="110"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.taskWorkloadUnit != null && scope.row.taskWorkloadUnit != ''">{{ dict.label[standardWorkloadUnit][scope.row.taskWorkloadUnit] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.taskProgress }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="settlementStatus" label="结算状态"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[settlementStatus][scope.row.settlementStatus] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" width="140" /> |
| | | <el-table-column prop="createTime" label="创建时间" width="140" /> |
| | | <el-table-column v-if="checkPer(['admin','taskDaliy:edit','taskDaliy:del'])" label="操作" width="150px" align="center"> |
| | | <el-table-column v-if="checkPer(['admin','taskDaliy:edit','taskDaliy:del'])" label="操作" width="150px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | :data="scope.row" |
| | |
| | | import crudProject from '@/api/project/project' |
| | | import crudTask from '@/api/task/task' |
| | | |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, projectId: null, taskId: null, userId: null, fillDate: null, consumedHours: null, consumedWorkload: null, taskProgress: null, settlementStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'TaskDaliy', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.STANDARD_WORKLOAD_UNIT], |
| | | dicts: [constant.STANDARD_WORKLOAD_UNIT, constant.SETTLEMENT_STATUS], |
| | | cruds() { |
| | | return CRUD({ title: '任务日报', url: 'api/taskDaliy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTaskDaliy }}) |
| | | }, |
| | |
| | | const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一千 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | // 比例(百内)验证 |
| | | var proportionValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一百 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | ], |
| | | consumedWorkload: [ |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | taskProgress: [ |
| | | { required: true, message: '任务进度不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | settlementStatus: [ |
| | | { required: true, message: '结算状态不能为空', trigger: 'change' } |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | |
| | | ], |
| | | // 字典:标准工作量单位 |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 字典:结算状态 |
| | | settlementStatus: constant.SETTLEMENT_STATUS, |
| | | // 用户列表 |
| | | users: [], |
| | | // 检索项目列表 |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = null |
| | | }, |
| | | // 钩子:编辑 - 之前 |
| | | [CRUD.HOOK.beforeToEdit]() { |
| | | // 获取项目 |
| | | crudProject.getPartake({ taskUserId: this.form.userId, approveStatus: constant.APPROVE_STATUS_ACKNOWLEDGED }).then(res => { |
| | | // 表单项目列表 |
| | | this.formProjects = res |
| | | }) |
| | | // 获取任务 |
| | | crudTask.getPartake({ taskUserId: this.form.userId, projectId: this.form.projectId }).then(res => { |
| | | // 表单任务列表 |
| | | this.formTasks = res |
| | | // 表单任务变更 |
| | | this.formTaskChange() |
| | | }) |
| | | }, |
| | | // 表单用户变更 |
| | | formUserChange() { |
| | | // 表单赋值 |
| | |
| | | if (this.formTasks[i].id === this.form.taskId) { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = this.formTasks[i].planWorkloadUnit |
| | | return |
| | | } |
| | | // 判断循环是否结束 |
| | | if (i === this.formTasks.length - 1) { |
| | | // 表单赋值 |
| | | this.form.consumedWorkloadUnit = null |
| | | } |
| | | } |
| | | } |