|
|
@@ -86,7 +86,80 @@ export default window.$crudCommon({
|
|
|
params: {
|
|
|
yearAndMonth: "",
|
|
|
},
|
|
|
- defaultColumns: [],
|
|
|
+ defaultColumns: [
|
|
|
+ {
|
|
|
+ label: '姓名',
|
|
|
+ prop: 'name',
|
|
|
+ span: 24,
|
|
|
+ search: true,
|
|
|
+ width: 90,
|
|
|
+ align: 'center',
|
|
|
+ type: 'input',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '工号',
|
|
|
+ prop: 'number',
|
|
|
+ type: 'input',
|
|
|
+ span: 24,
|
|
|
+ width: 90,
|
|
|
+ align: 'center',
|
|
|
+ search: true,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '身份证号',
|
|
|
+ prop: 'idCard',
|
|
|
+ type: 'input',
|
|
|
+ span: 24,
|
|
|
+ search: true,
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '科研人员类别',
|
|
|
+ prop: 'personnelType',
|
|
|
+ type: 'select',
|
|
|
+ span: 24,
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ search: true,
|
|
|
+ dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
|
|
|
+ props: {
|
|
|
+ label: 'dictValue',
|
|
|
+ value: 'dictKey',
|
|
|
+ },
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '类别',
|
|
|
+ prop: 'gslb',
|
|
|
+ span: 24,
|
|
|
+ width: 90,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "hoursTotal",
|
|
|
+ label: "合计",
|
|
|
+ width: 50,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ display: false,
|
|
|
+ }, {
|
|
|
+ prop: "hoursRate",
|
|
|
+ label: "工时分配率",
|
|
|
+ width: 60,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ display: false,
|
|
|
+ }
|
|
|
+ ],
|
|
|
|
|
|
wideTableColumns: [],
|
|
|
printTitle: "",
|
|
|
@@ -108,57 +181,46 @@ export default window.$crudCommon({
|
|
|
return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '')
|
|
|
}
|
|
|
},
|
|
|
- async created() {
|
|
|
- this.defaultColumns = deepClone(this.option.column);
|
|
|
- this.refreshTableCol(this.params.yearAndMonth);
|
|
|
- },
|
|
|
- beforeDestroy() {
|
|
|
- this.option.column = deepClone(this.defaultColumns);
|
|
|
- },
|
|
|
methods: {
|
|
|
refreshTableCol(yearAndMonth) {
|
|
|
let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
|
|
|
const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
|
|
|
-
|
|
|
+ for (let i=monthDays.length; i<31; i++) {
|
|
|
+ let _day = i+1
|
|
|
+ monthDays.push({
|
|
|
+ day: _day,
|
|
|
+ hide: true
|
|
|
+ });
|
|
|
+ }
|
|
|
let newColumns = deepClone(this.defaultColumns);
|
|
|
- this.allMonthCols = [];
|
|
|
- monthDays.forEach((item) => {
|
|
|
- let col = {
|
|
|
- prop: moment(item.dateString).format('yyyyMMDD'),
|
|
|
- label: item.dayName + "" + item.day.toString(),
|
|
|
- type: 'number',
|
|
|
- precision: 1,
|
|
|
- min: 0,
|
|
|
- width: 50,
|
|
|
- align: 'center',
|
|
|
- isWorkDay: ChineseHoliday.isWorkday(item.dateString),
|
|
|
- showOverflowTooltip: true,
|
|
|
+ monthDays.forEach((item, index) => {
|
|
|
+ let col = {};
|
|
|
+ if (item.hide) {
|
|
|
+ col = {
|
|
|
+ hide: true,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ col = {
|
|
|
+ prop: moment(item.dateString).format('yyyyMMDD'),
|
|
|
+ label: item.dayName + "" + item.day.toString(),
|
|
|
+ type: 'number',
|
|
|
+ precision: 1,
|
|
|
+ min: 0,
|
|
|
+ width: 50,
|
|
|
+ align: 'center',
|
|
|
+ isWorkDay: ChineseHoliday.isWorkday(item.dateString),
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ hide: item.hide
|
|
|
+ };
|
|
|
}
|
|
|
-
|
|
|
if (!ChineseHoliday.isWorkday(item.dateString)) {
|
|
|
col.labelClassName = 'red';
|
|
|
col.labelClassName = 'red';
|
|
|
}
|
|
|
newColumns.push(col);
|
|
|
- this.allMonthCols.push(moment(item.dateString).format('yyyyMMDD'));
|
|
|
- });
|
|
|
- newColumns.push({
|
|
|
- prop: "hoursTotal",
|
|
|
- label: "合计",
|
|
|
- width: 50,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- display: false,
|
|
|
- }, {
|
|
|
- prop: "hoursRate",
|
|
|
- label: "工时分配率",
|
|
|
- width: 60,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- display: false,
|
|
|
});
|
|
|
|
|
|
- this.option.column = [...newColumns];
|
|
|
+ this.option.column = newColumns;
|
|
|
},
|
|
|
handleExport() {
|
|
|
exportBloByPost(`/api/kd-scientific/xm/technician/hours/myyfgsfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|