From f294efb8c01ad8b0704a92d51c14dbd55d898874 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:46 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)
---
src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue | 263 +++++++++++++++++++++++++++-------------------------
1 files changed, 137 insertions(+), 126 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue b/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue
index 8af11b0..a003633 100644
--- a/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue
+++ b/src/views/CNAS/personnel/personnelInfo/tabs/personnelTraining.vue
@@ -2,60 +2,58 @@
<template>
<div class="flex_column">
<div v-if="!editPlanShow && isDepartment">
- <div style="display: flex;justify-content: space-between;">
- <el-form :model="page" ref="page" size="small" :inline="true">
- <el-form-item label="缂栧埗浜�">
- <el-input v-model="page.compilerName" clearable></el-input>
- </el-form-item>
- <el-form-item>
- <el-button size="small" type="primary" @click="getYearPlanList(departId)">鏌� 璇�</el-button>
- </el-form-item>
- </el-form>
- <div>
+ <div class="title">
+ <span style="font-weight: bold">骞村害璁″垝</span>
+ </div>
+ <div style="display: flex;justify-content: space-between">
+ <div style="display: flex;">
+ <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
+ <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">缂栧埗浜�</span>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="page.compilerName"
+ @keyup.enter.native="getYearPlanList(departId)"></el-input>
+ </div>
+ <div style="line-height: 30px;">
+ <el-button type="primary" size="mini" @click="getYearPlanList(departId)">鏌ヨ</el-button>
+ </div>
+ </div>
+ <div style="line-height: 30px;">
<el-button size="small" type="primary" @click="uploadDia = true, getUserList()">瀵煎叆</el-button>
</div>
</div>
- <lims-table :tableData="yearPlanTableData" :column="yearPlanColumn"
- :currentChange="currentChange"
- @pagination="pagination" :height="'calc(100vh - 290px)'"
- :page="page" :tableLoading="yearLoading"></lims-table>
+ <lims-table :tableData="yearPlanTableData" :column="yearPlanColumn" :currentChange="currentChange"
+ @pagination="pagination" height="40vh" :page="page" :tableLoading="yearLoading"></lims-table>
</div>
<div v-if="!editPlanShow" class="table">
- <div v-if="!editPlanShow && isDepartment">
- <div style="display: flex;justify-content: space-between;">
- <el-form :model="inDetailForm" ref="inDetailForm" size="small" :inline="true">
- <el-form-item label="鍩硅璁插笀">
- <el-input v-model="inDetailForm.trainingLecturerName" class="search" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
- </el-form-item>
- <el-form-item label="鍩硅鏃ユ湡">
- <el-date-picker v-model="inDetailForm.trainingDate" clearable
- format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
- type="date" value-format="yyyy-MM-dd"></el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button size="small" type="primary" @click="searchTable">鏌� 璇�</el-button>
- </el-form-item>
- </el-form>
- <div>
- <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" @click="batchDelete">鎵归噺鍒犻櫎</el-button>
- <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" type="primary" @click="addTrainingPlan('add')">鏂板</el-button>
+ <div>
+ <div class="title">
+ <span style="font-weight: bold">骞村害璁″垝鏄庣粏</span>
+ </div>
+ <div style="display: flex;justify-content: space-between">
+ <div style="display: flex;">
+ <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
+ <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">鍩硅璁插笀</span>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="inDetailForm.trainingLecturerName"
+ @keyup.enter.native="searchTable"></el-input>
+ </div>
+ <div style="line-height: 30px;">
+ <el-button size="mini" type="primary" @click="searchTable">鏌ヨ</el-button>
+ </div>
+ </div>
+ <div style="line-height: 30px;">
+ <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small"
+ @click="batchDelete">鎵归噺鍒犻櫎</el-button>
+ <el-button v-if="isDepartment && currentChangeRow && isOperation" size="small" type="primary"
+ @click="addTrainingPlan('add')">鏂板</el-button>
</div>
</div>
<lims-table :tableData="inDetailPlanTableData" :column="inDetailPlanColumn"
- :currentChange="currentChange" :height="isDepartment ? '45vh' : '68vh' "
- :isSelection="true" :handleSelectionChange="handleSelectionChange"
- @pagination="pagination1"
- :page="inDetailPagination" :tableLoading="yearLoading"></lims-table>
+ :height="isDepartment ? '40vh' : '62vh'" :isSelection="true" :handleSelectionChange="handleSelectionChange"
+ @pagination="pagination1" :page="inDetailPagination" :tableLoading="yearDetailLoading"></lims-table>
</div>
</div>
<Add ref="addPlan" :currentChangeRow="currentChangeRow" @search="getInDetailPlan(currentRowId, departId)"></Add>
- <Edit
- v-if="editPlanShow"
- ref="editPlan"
- :currentRow="currentRow"
- @del="getInDetailPlan(currentRowId, departId)"
- @goBack="goBack"
- ></Edit>
+ <Edit v-if="editPlanShow" ref="editPlan" :currentRow="currentRow" @del="getInDetailPlan(currentRowId, departId)"
+ @goBack="goBack"></Edit>
<el-dialog :visible.sync="reviewDialog" title="瀹℃牳" width="30%" @close="auditRemarks = ''">
<span>
瀹℃牳澶囨敞锛�
@@ -63,8 +61,7 @@
</span>
<span style="margin-top: 10px;display: inline-block">
鎵瑰噯浜猴細
- <el-select v-model="approverId" clearable
- filterable size="small" style="width: 70%;">
+ <el-select v-model="approverId" clearable filterable size="small" style="width: 70%;">
<el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@@ -86,30 +83,23 @@
</el-dialog>
<el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px">
<div style="display: flex;align-items: center;">
- <div style="width: 70px">骞翠唤锛�</div>
- <el-date-picker
- v-model="planYear"
- type="year"
- value-format="yyyy"
- clearable
- size="small"
- format="yyyy"
+ <div style="width: 70px"><span class="required-span">* </span>骞翠唤锛�</div>
+ <el-date-picker v-model="planYear" type="year" value-format="yyyy" clearable size="small" format="yyyy"
placeholder="閫夋嫨骞�">
</el-date-picker>
</div>
<div style="display: flex;align-items: center;margin: 10px 0">
- <div style="width: 70px">瀹℃牳浜猴細</div>
- <el-select v-model="reviewerId" clearable
- filterable size="small" style="width: 50%;">
+ <div style="width: 70px"><span class="required-span">* </span>瀹℃牳浜猴細</div>
+ <el-select v-model="reviewerId" clearable filterable size="small" style="width: 50%;">
<el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
<div style="margin: 0 auto;">
- <el-upload ref="upload" :action="javaApi + '/personTraining/personTrainingImport' + '?planYear=' + planYear + '&reviewerId=' + reviewerId"
- :auto-upload="false" :before-upload="beforeUpload" :file-list="fileList" :headers="uploadHeader"
- :limit="1" :on-error="onError" :on-success="onSuccess" accept=".xlsx" drag
- name="file">
+ <el-upload ref="upload"
+ :action="javaApi + '/personTraining/personTrainingImport' + '?planYear=' + planYear + '&reviewerId=' + reviewerId"
+ :auto-upload="false" :before-upload="beforeUpload" :file-list="fileList" :headers="uploadHeader" :limit="1"
+ :on-error="onError" :on-success="onSuccess" accept=".xlsx" drag name="file">
<i class="el-icon-upload"></i>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
</el-upload>
@@ -118,7 +108,7 @@
<el-button @click="uploadDia = false">鍙� 娑�</el-button>
<el-button :loading="uploading" type="primary" @click="submitUpload()">涓� 浼�</el-button>
</span>
- </el-dialog >
+ </el-dialog>
<view-record v-if="ViewRecord" ref="ViewRecord"></view-record>
</div>
</template>
@@ -128,18 +118,18 @@
import Edit from '../components/Edit.vue';
import ViewRecord from "../components/ViewRecord.vue";
import limsTable from "@/components/Table/lims-table.vue";
-import {mapGetters} from "vuex";
+import { mapGetters } from "vuex";
import {
approveAnnualPersonnelTraining, deleteAnnualPlanDetailTable, exportPersonTraining, exportPersonTrainingRecord,
personTraining,
personTrainingDelete,
queryTheAnnualPlanDetailsTable, reviewAnnualPersonnelTraining
} from "@/api/cnas/personal/personalTraining";
-import {selectUserCondition} from "@/api/system/user";
+import { selectUserCondition } from "@/api/system/user";
export default {
name: 'PersonnelTraining',
- components: {limsTable, ViewRecord, Add, Edit },
+ components: { limsTable, ViewRecord, Add, Edit },
props: {
departId: {
type: Number,
@@ -167,6 +157,7 @@
trainingDate: '',
},
yearLoading: false,
+ yearDetailLoading: false,
yearPlanTableData: [], // 骞村害璁″垝琛ㄦ暟鎹�
yearPlanColumn: [
{
@@ -177,7 +168,7 @@
label: '鍒涘缓鏃堕棿',
width: '160px',
prop: 'createTime'
- },{
+ }, {
label: '缂栧埗浜�',
prop: 'compilerName'
}, {
@@ -244,7 +235,7 @@
formatType: (params) => {
if (params == 1) {
return 'success';
- } else if (params == 2) {
+ } else if (params == 2) {
return 'danger';
} else {
return null
@@ -264,7 +255,7 @@
name: '瀵煎嚭',
type: 'text',
disabled: (row) => {
- if(row.approvalStatus === 1 && row.reviewerStatus === 1) {
+ if (row.approvalStatus === 1 && row.reviewerStatus === 1) {
return false;
} else {
return true;
@@ -278,7 +269,7 @@
name: '瀹℃牳',
type: 'text',
disabled: (row) => {
- if(row.reviewerStatus === 1 || this.userId != row.reviewerId) {
+ if (row.reviewerStatus === 1 || this.userId != row.reviewerId) {
return true;
} else {
return false;
@@ -292,7 +283,7 @@
name: '鎵瑰噯',
type: 'text',
disabled: (row) => {
- if(row.approvalStatus === 1 || this.userId != row.approverId) {
+ if (row.approvalStatus === 1 || this.userId != row.approverId || row.reviewerStatus != 1) {
return true;
} else {
return false;
@@ -310,7 +301,7 @@
this.deleteFun(row.id);
},
disabled: (row) => {
- if(row.reviewerStatus === 1) {
+ if (row.reviewerStatus === 1) {
return true;
} else {
return false;
@@ -321,7 +312,7 @@
}],
inDetailPlanTableData: [], // 骞村害璁″垝鏄庣粏琛ㄨ〃鏁版嵁
inDetailPlanColumn: [
- {
+ {
label: '鍩硅鐩爣',
prop: 'trainingObjectives',
width: '100px',
@@ -435,15 +426,15 @@
]
}],
page: {
- total:0,
- size:10,
- current:1,
+ total: 0,
+ size: 10,
+ current: 1,
compilerName: ""
},
inDetailPagination: {
- total:0,
- size:10,
- current:1,
+ total: 0,
+ size: 10,
+ current: 1,
},
editPlanShow: false,
currentRow: {},
@@ -472,43 +463,47 @@
}
},
methods: {
- searchTable () {
+ searchTable() {
this.getInDetailPlan(this.currentRowId)
},
// 鏌ヨ-骞村害璁″垝琛�
getYearPlanList(userId) {
+ this.yearLoading = true
const params = this.isDepartment ?
- {
- departmentId: userId,
- size: this.page.size,
- current: this.page.current,
- compilerName: this.page.compilerName,
- }: {
+ {
+ departmentId: userId,
+ size: this.page.size,
+ current: this.page.current,
+ compilerName: this.page.compilerName,
+ } : {
userId: userId,
size: this.page.size,
current: this.page.current,
compilerName: this.page.compilerName,
}
personTraining(params).then(res => {
+ this.yearLoading = false
this.yearPlanTableData = res.data.records;
this.pagination.total = res.data.total;
if (this.yearPlanTableData.length > 0) {
this.currentRowId = this.yearPlanTableData[0].id
this.currentChange(this.yearPlanTableData[0])
}
- });
+ }).catch(err => {
+ this.yearLoading = false
+ })
},
- pagination (page) {
+ pagination(page) {
this.page.size = page.limit
this.getYearPlanList()
},
- currentChange (row) {
+ currentChange(row) {
const now = new Date();
const currentYear = now.getFullYear();
if (row) {
this.currentChangeRow = row
this.currentRowId = row.id
- if (row.createTime.slice(0,4) == currentYear) {
+ if (row.createTime.slice(0, 4) == currentYear) {
this.isOperation = true;
} else {
this.isOperation = false;
@@ -516,26 +511,30 @@
this.getInDetailPlan(row.id)
}
},
- getInDetailPlan (id) {
+ getInDetailPlan(id) {
if (this.inDetailForm.trainingDate === null) {
this.inDetailForm.trainingDate = ''
}
const userId = this.isDepartment ? '' : this.departId
const params =
- {
- userId: userId,
- size: this.inDetailPagination.pageSize,
- current: this.inDetailPagination.current,
- id: id,
- trainingLecturerName: this.inDetailForm.trainingLecturerName,
- trainingDate: this.inDetailForm.trainingDate,
- }
+ {
+ userId: userId,
+ size: this.inDetailPagination.pageSize,
+ current: this.inDetailPagination.current,
+ id: id,
+ trainingLecturerName: this.inDetailForm.trainingLecturerName,
+ trainingDate: this.inDetailForm.trainingDate,
+ }
+ this.yearDetailLoading = true
queryTheAnnualPlanDetailsTable(params).then(res => {
+ this.yearDetailLoading = false
this.inDetailPlanTableData = res.data.records;
this.inDetailPagination.total = res.data.total;
- });
+ }).catch(err => {
+ this.yearDetailLoading = false
+ })
},
- pagination1 (page) {
+ pagination1(page) {
this.inDetailPagination.size = page.limit
this.getInDetailPlan(this.currentRowId)
},
@@ -554,7 +553,7 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- personTrainingDelete({id: id}).then(res => {
+ personTrainingDelete({ id: id }).then(res => {
this.$message.success('鍒犻櫎鎴愬姛锛�');
this.getYearPlanList(this.departId);
});
@@ -572,7 +571,7 @@
this.getUserList()
},
// 鎻愪氦瀹℃牳
- handleReview (status) {
+ handleReview(status) {
const personTrainingUpdateDto = {
id: this.currentRowId,
auditRemarks: this.auditRemarks,
@@ -597,7 +596,7 @@
this.approvalDialog = true
},
// 鎻愪氦鎵瑰噯
- handleApproval (status) {
+ handleApproval(status) {
const personTrainingUpdateDto = {
id: this.currentRowId,
approvalRemarks: this.approvalRemarks,
@@ -617,15 +616,22 @@
},
// 骞村害璁″垝琛�-涓嬭浇
downLoadPost(row) {
- exportPersonTraining({id: row.id}).then(res => {
+ exportPersonTraining({ id: row.id }).then(res => {
this.outLoading = false
- const blob = new Blob([res],{ type: 'application/msword' });
+ const blob = new Blob([res], { type: 'application/msword' });
this.$download.saveAs(blob, row.fileName + '.docx')
- this.$message.success('瀵煎嚭鎴愬姛')
})
},
// 骞村害璁″垝-瀵煎叆
submitUpload() {
+ if (!this.planYear) {
+ this.$message.error('璇烽�夋嫨骞翠唤')
+ return
+ }
+ if (!this.reviewerId) {
+ this.$message.error('璇烽�夋嫨瀹℃牳浜�')
+ return
+ }
if (this.$refs.upload.uploadFiles.length == 0) {
this.$message.error('鏈�夋嫨鏂囦欢')
return
@@ -639,7 +645,7 @@
this.uploadDia = false
this.uploading = false
if (response.code != 200) {
- this.$message.error(response.message)
+ this.$message.error(response.msg)
return
}
this.$message.success('涓婁紶鎴愬姛')
@@ -669,7 +675,7 @@
this.editPlanShow = false;
this.getInDetailPlan(this.currentRowId)
},
- viewRecord (row) {
+ viewRecord(row) {
this.ViewRecord = true
this.$nextTick(() => {
this.$refs.ViewRecord.openDia(row)
@@ -677,11 +683,10 @@
},
// 骞村害璁″垝鏄庣粏琛�-涓嬭浇
downLoadInDetail(row) {
- exportPersonTrainingRecord({id: row.id}).then(res => {
+ exportPersonTrainingRecord({ id: row.id }).then(res => {
this.outLoading = false
- const blob = new Blob([res],{ type: 'application/msword' });
+ const blob = new Blob([res], { type: 'application/msword' });
this.$download.saveAs(blob, '浜哄憳鍩硅涓庤�冩牳璁板綍.docx')
- this.$message.success('瀵煎嚭鎴愬姛')
})
},
// 骞村害璁″垝鏄庣粏琛�-澶氶��
@@ -689,7 +694,7 @@
this.multipleSelection = list
},
// 骞村害鏄庣粏琛�-鍒犻櫎
- batchDelete () {
+ batchDelete() {
if (this.multipleSelection.length > 0) {
let ids = []
this.multipleSelection.forEach(item => {
@@ -700,7 +705,7 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- deleteAnnualPlanDetailTable({ids: ids.join(',')}).then(res => {
+ deleteAnnualPlanDetailTable({ ids: ids.join(',') }).then(res => {
if (res.code == 200) {
this.$message.success('鍒犻櫎鎴愬姛');
this.getInDetailPlan(this.currentRowId);
@@ -762,22 +767,28 @@
justify-content: space-between;
}
-.pagination {
- display: flex;
- justify-content: space-between
-}
-
-.items_center {
- display: flex;
- align-items: center;
-}
-
-.date_box {
- margin: 0 5px;
-}
-
.search {
width: 150px;
margin: 0 16px;
}
+
+.title {
+ position: relative;
+ font-size: 16px;
+ color: #333;
+ font-weight: 400;
+ padding-left: 10px;
+ margin-bottom: 10px;
+}
+
+.title::before {
+ position: absolute;
+ left: 0;
+ top: 4px;
+ content: '';
+ width: 4px;
+ height: 16px;
+ background-color: #3A7BFA;
+ border-radius: 2px;
+}
</style>
--
Gitblit v1.9.3