|
|
@@ -26,8 +26,18 @@
|
|
|
<el-input v-model="params.cygs" />
|
|
|
</template>
|
|
|
|
|
|
- <template #name="scope">
|
|
|
- <span style="color: blue;">{{scope.row.name}}</span>
|
|
|
+ <template slot="situationCountSearch">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <span>参研个数:</span>
|
|
|
+ <avue-input-number v-model="params.situationCountMin" :min="0" style="width: 100px !important;"></avue-input-number>
|
|
|
+ <span style="width: 20px; text-align: center;">至</span>
|
|
|
+ <avue-input-number v-model="params.situationCountMax" :min="0" style="width: 100px !important;"></avue-input-number>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-for="col of redColKey" :slot="col" slot-scope="{ row }">
|
|
|
+ <span v-if="row.total < 183" style="color: red;" :key="col">{{ row[col] }}</span>
|
|
|
+ <span v-else style="color: #606266;" :key="col">{{ row[col] }}</span>
|
|
|
</template>
|
|
|
|
|
|
</avue-crud>
|
|
|
@@ -52,6 +62,7 @@ import NProgress from 'nprogress';
|
|
|
import 'nprogress/nprogress.css';
|
|
|
import {getToken} from "@/util/auth";
|
|
|
import {downloadXls} from "@/util/util";
|
|
|
+import Decimal from "decimal.js";
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
|
@@ -65,6 +76,8 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
wideTableColumns: [],
|
|
|
printTitle: "",
|
|
|
+
|
|
|
+ redColKey: ['7', '8', '9', '10', '11', '12'],
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -74,7 +87,6 @@ export default window.$crudCommon({
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- loadData() {},
|
|
|
handleExport() {
|
|
|
this.$confirm("是否导出吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -82,7 +94,7 @@ export default window.$crudCommon({
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
NProgress.start();
|
|
|
- exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
+ exportBloByPost(`/api/kd-scientific/technician/cyryhmc/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
downloadXls(res.data, `${this.params.yearAndMonth}参研人员花名册.xlsx`);
|
|
|
NProgress.done();
|
|
|
})
|
|
|
@@ -102,6 +114,29 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
}, {
|
|
|
// 模块路径
|
|
|
- name: 'techPerson/cyPersonRoster'
|
|
|
+ name: 'techPerson/cyPersonRoster',
|
|
|
+ res: ({ data }) => {
|
|
|
+ data.records = data.records.map(item => {
|
|
|
+ let cyxmList = item.xmList.map(item => item.xmmc);
|
|
|
+ item.cyxm = cyxmList.join(';');
|
|
|
+ item.situationCount = item.xmList.length;
|
|
|
+
|
|
|
+ item.hoursList = item.hoursList.forEach(hourItem => {
|
|
|
+ item[Number(hourItem.workDate.substring(hourItem.workDate.length - 2))] = hourItem.workHours;
|
|
|
+ });
|
|
|
+
|
|
|
+ let total = new Decimal(0);
|
|
|
+ for (let i=0; i<12; i++) {
|
|
|
+ console.log(item[`${i+1}`])
|
|
|
+ total = total.add(new Decimal(item[`${i+1}`] || 0));
|
|
|
+ }
|
|
|
+ item.total = total;
|
|
|
+
|
|
|
+
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|