Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // é¶è¡ç®¡ç |
| | | export function bankList() { |
| | | return request({ |
| | | url: "/bank/list", |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | export function bankAdd(data) { |
| | | return request({ |
| | | url: "/bank/add", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | export function bankUpdate(data) { |
| | | return request({ |
| | | url: "/bank/update", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | export function bankDelete(ids) { |
| | | return request({ |
| | | url: "/bank/delete", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| | | } |
| | | |
| | |
| | | // å页æ¥è¯¢å表 |
| | | export function socialSecurityListPage(query) { |
| | | return request({ |
| | | url: "/socialSecurity/plan/listPage", |
| | | url: "/schemeApplicableStaff/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | |
| | | // æ¥è¯¢è¯¦æ
|
| | | export function socialSecurityInfo(id) { |
| | | return request({ |
| | | url: "/socialSecurity/plan/" + id, |
| | | url: "/schemeApplicableStaff/" + id, |
| | | method: "get", |
| | | }); |
| | | } |
| | |
| | | // æ°å¢ |
| | | export function socialSecurityAdd(data) { |
| | | return request({ |
| | | url: "/socialSecurity/plan/add", |
| | | url: "/schemeApplicableStaff/add", |
| | | method: "post", |
| | | data, |
| | | }); |
| | |
| | | // ä¿®æ¹ |
| | | export function socialSecurityUpdate(data) { |
| | | return request({ |
| | | url: "/socialSecurity/plan/update", |
| | | url: "/schemeApplicableStaff/updateSchemeApplicableStaff", |
| | | method: "post", |
| | | data, |
| | | }); |
| | |
| | | // å é¤ |
| | | export function socialSecurityDelete(ids) { |
| | | return request({ |
| | | url: "/socialSecurity/plan/delete", |
| | | url: "/schemeApplicableStaff/delete", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // å工工èµä¸»è¡¨ |
| | | export function staffSalaryMainListPage(params) { |
| | | return request({ |
| | | url: "/staffSalaryMain/listPage", |
| | | method: "get", |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | export function staffSalaryMainCalculateSalary(ids) { |
| | | return request({ |
| | | url: "/staffSalaryMain/calculateSalary", |
| | | method: "post", |
| | | data: ids, |
| | | }); |
| | | } |
| | | |
| | | export function staffSalaryMainAdd(data) { |
| | | return request({ |
| | | url: "/staffSalaryMain/add", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | export function staffSalaryMainUpdate(data) { |
| | | return request({ |
| | | url: "/staffSalaryMain/update", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | export function staffSalaryMainDelete(ids) { |
| | | return request({ |
| | | url: "/staffSalaryMain/delete", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| | | } |
| | | |
| | |
| | | <slot></slot> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="handleConfirm">确认</el-button> |
| | | <el-button |
| | | v-if="showConfirm" |
| | | type="primary" |
| | | @click="handleConfirm" |
| | | > |
| | | 确认 |
| | | </el-button> |
| | | <el-button @click="handleCancel">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | set: (val) => emit('update:modelValue', val) |
| | | }) |
| | | |
| | | // 详æ
模å¼ä¸å±ç¤ºâ确认âæé®ï¼å
¶å®ç±»åæ£å¸¸æ¾ç¤º |
| | | const showConfirm = computed(() => props.operationType !== 'detail') |
| | | |
| | | const computedTitle = computed(() => { |
| | | if (typeof props.title === 'function') { |
| | | return props.title(props.operationType) |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="å«å" prop="aliasName"> |
| | | <el-form-item label="å«å" prop="alias"> |
| | | <el-input |
| | | v-model="form.aliasName" |
| | | v-model="form.alias" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="50" |
| | |
| | | |
| | | <el-row :gutter="24"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="è§è²" prop="roleIds"> |
| | | <el-form-item label="è§è²" prop="roleId"> |
| | | <el-select |
| | | v-model="form.roleIds" |
| | | multiple |
| | | v-model="form.roleId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | æè²ç»å |
| | | </span> |
| | | </template> |
| | | <el-table :data="form.educationList" border> |
| | | <el-table-column label="å¦å" prop="degree" width="120"> |
| | | <el-table :data="form.staffEducationList" border> |
| | | <el-table-column label="å¦å" prop="education" width="120"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="row.degree" |
| | | v-model="row.education" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¯ä¸é¢æ ¡" prop="school" min-width="160"> |
| | | <el-table-column label="æ¯ä¸é¢æ ¡" prop="schoolName" min-width="160"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.school" |
| | | v-model="row.schoolName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="30" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å
¥å¦æ¶é´" prop="admissionDate" width="150"> |
| | | <el-table-column label="å
¥å¦æ¶é´" prop="enrollTime" width="150"> |
| | | <template #default="{ row }"> |
| | | <el-date-picker |
| | | v-model="row.admissionDate" |
| | | v-model="row.enrollTime" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¯ä¸æ¶é´" prop="graduationDate" width="150"> |
| | | <el-table-column label="æ¯ä¸æ¶é´" prop="graduateTime" width="150"> |
| | | <template #default="{ row }"> |
| | | <el-date-picker |
| | | v-model="row.graduationDate" |
| | | v-model="row.graduateTime" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¦ä½" prop="academicDegree" width="140"> |
| | | <el-table-column label="å¦ä½" prop="degree" width="140"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.academicDegree" |
| | | v-model="row.degree" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | |
| | | <el-table-column label="æä½" width="80" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-if="form.educationList.length > 1" |
| | | v-if="form.staffEducationList.length > 1" |
| | | type="primary" |
| | | link |
| | | @click="removeEducationRow(scope.$index)" |
| | |
| | | å·¥ä½ç»å |
| | | </span> |
| | | </template> |
| | | <el-table :data="form.workExperienceList" border> |
| | | <el-table-column label="åå
¬å¸" prop="company" min-width="180"> |
| | | <el-table :data="form.staffWorkExperienceList" border> |
| | | <el-table-column label="åå
¬å¸" prop="formerCompany" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.company" |
| | | v-model="row.formerCompany" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="30" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åå
¬å¸é¨é¨" prop="department" min-width="140"> |
| | | <el-table-column label="åå
¬å¸é¨é¨" prop="formerDept" min-width="140"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.department" |
| | | v-model="row.formerDept" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åå
¬å¸èä½" prop="position" min-width="140"> |
| | | <el-table-column label="åå
¬å¸èä½" prop="formerPosition" min-width="140"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.position" |
| | | v-model="row.formerPosition" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å·¥ä½æè¿°" prop="description" min-width="220"> |
| | | <el-table-column label="å·¥ä½æè¿°" prop="workDesc" min-width="220"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.description" |
| | | v-model="row.workDesc" |
| | | type="textarea" |
| | | :rows="2" |
| | | placeholder="请è¾å
¥" |
| | |
| | | <el-table-column label="æä½" width="80" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-if="form.workExperienceList.length > 1" |
| | | v-if="form.staffWorkExperienceList.length > 1" |
| | | type="primary" |
| | | link |
| | | @click="removeWorkRow(scope.$index)" |
| | |
| | | const { form } = toRefs(props); |
| | | |
| | | const addEducationRow = () => { |
| | | form.value.educationList.push({ |
| | | degree: "", |
| | | school: "", |
| | | admissionDate: "", |
| | | graduationDate: "", |
| | | form.value.staffEducationList.push({ |
| | | education: "", |
| | | schoolName: "", |
| | | enrollTime: "", |
| | | graduateTime: "", |
| | | major: "", |
| | | academicDegree: "", |
| | | degree: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeEducationRow = (index) => { |
| | | if (form.value.educationList.length <= 1) return; |
| | | form.value.educationList.splice(index, 1); |
| | | if (form.value.staffEducationList.length <= 1) return; |
| | | form.value.staffEducationList.splice(index, 1); |
| | | }; |
| | | |
| | | const addWorkRow = () => { |
| | | form.value.workExperienceList.push({ |
| | | company: "", |
| | | department: "", |
| | | position: "", |
| | | form.value.staffWorkExperienceList.push({ |
| | | formerCompany: "", |
| | | formerDept: "", |
| | | formerPosition: "", |
| | | startDate: "", |
| | | endDate: "", |
| | | description: "", |
| | | workDesc: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeWorkRow = (index) => { |
| | | if (form.value.workExperienceList.length <= 1) return; |
| | | form.value.workExperienceList.splice(index, 1); |
| | | if (form.value.staffWorkExperienceList.length <= 1) return; |
| | | form.value.staffWorkExperienceList.splice(index, 1); |
| | | }; |
| | | </script> |
| | | |
| | |
| | | ç´§æ¥è系人 |
| | | </span> |
| | | </template> |
| | | <el-table :data="form.emergencyContacts" border> |
| | | <el-table-column label="ç´§æ¥è系人å§å" prop="name" min-width="160"> |
| | | <el-table :data="form.staffEmergencyContactList" border> |
| | | <el-table-column label="ç´§æ¥è系人å§å" prop="contactName" min-width="160"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.name" |
| | | v-model="row.contactName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="50" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç´§æ¥è系人å
³ç³»" prop="relation" min-width="140"> |
| | | <el-table-column label="ç´§æ¥è系人å
³ç³»" prop="contactRelation" min-width="140"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.relation" |
| | | v-model="row.contactRelation" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç´§æ¥èç³»äººææº" prop="phone" width="160"> |
| | | <el-table-column label="ç´§æ¥èç³»äººææº" prop="contactPhone" width="160"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.phone" |
| | | v-model="row.contactPhone" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="11" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç´§æ¥è系人ä½å" prop="address" min-width="220"> |
| | | <el-table-column label="ç´§æ¥è系人ä½å" prop="contactAddress" min-width="220"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.address" |
| | | v-model="row.contactAddress" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="50" |
| | |
| | | <el-table-column label="æä½" width="80" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | v-if="form.emergencyContacts.length > 1" |
| | | v-if="form.staffEmergencyContactList.length > 1" |
| | | type="primary" |
| | | link |
| | | @click="removeEmergencyRow(scope.$index)" |
| | |
| | | const { form } = toRefs(props); |
| | | |
| | | const addEmergencyRow = () => { |
| | | form.value.emergencyContacts.push({ |
| | | name: "", |
| | | relation: "", |
| | | phone: "", |
| | | address: "", |
| | | form.value.staffEmergencyContactList.push({ |
| | | contactName: "", |
| | | contactRelation: "", |
| | | contactPhone: "", |
| | | contactAddress: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeEmergencyRow = (index) => { |
| | | if (form.value.emergencyContacts.length <= 1) return; |
| | | form.value.emergencyContacts.splice(index, 1); |
| | | if (form.value.staffEmergencyContactList.length <= 1) return; |
| | | form.value.staffEmergencyContactList.splice(index, 1); |
| | | }; |
| | | </script> |
| | | |
| | |
| | | </span> |
| | | </template> |
| | | |
| | | <!-- 第ä¸è¡ï¼ååå¼å§ / ååç»æ / è¯ç¨æ / è½¬æ£ --> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="å·¥å·" prop="jobNo"> |
| | | <el-input |
| | | v-model="form.jobNo" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="å工类å" prop="staffType"> |
| | | <el-select |
| | | v-model="form.staffType" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="æ£å¼åå·¥" value="official" /> |
| | | <el-option label="è¯ç¨åå·¥" value="probation" /> |
| | | <el-option label="å®ä¹ ç" value="intern" /> |
| | | <el-option label="å
¼è" value="part_time" /> |
| | | <el-option label="å³å¡/å¤å
" value="outsourcing" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="å
¥èæ¥æ" prop="entryDate"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="å
¥èæ¥æ" prop="contractStartTime"> |
| | | <el-date-picker |
| | | v-model="form.entryDate" |
| | | v-model="form.contractStartTime" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-col :span="6"> |
| | | <el-form-item |
| | | label="ååç»ææ¥æ" |
| | | prop="contractEndTime" |
| | | required |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©ååç»ææ¥æ', |
| | | trigger: 'change', |
| | | }, |
| | | ]" |
| | | > |
| | | <el-date-picker |
| | | v-model="form.contractEndTime" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="è¯ç¨æï¼æï¼" prop="probationPeriod"> |
| | | <el-input-number |
| | | v-model="form.probationPeriod" |
| | | v-model="form.proTerm" |
| | | :min="0" |
| | | :max="24" |
| | | :precision="0" |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="è½¬æ£æ¥æ" prop="regularDate"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="è½¬æ£æ¥æ" prop="positiveDate"> |
| | | <el-date-picker |
| | | v-model="form.regularDate" |
| | | v-model="form.positiveDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- 第äºè¡ï¼é¨é¨ / å²ä½ / åºæ¬å·¥èµ --> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="é¨é¨" prop="sysDeptId"> |
| | |
| | | :render-after-expand="false" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ç´æ¥ä¸çº§" prop="directLeader"> |
| | | <el-input |
| | | v-model="form.directLeader" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="50" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="24"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="è级" prop="jobLevel"> |
| | | <el-input |
| | | v-model="form.jobLevel" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="10" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="åºæ¬å·¥èµ" prop="basicSalary"> |
| | | <el-input-number |
| | | v-model="form.basicSalary" |
| | |
| | | operationType.value === "add" ? "æ°å¢å
¥è" : "ç¼è¾äººå"; |
| | | |
| | | const createEmptyEducation = () => ({ |
| | | degree: "", |
| | | school: "", |
| | | admissionDate: "", |
| | | graduationDate: "", |
| | | education: "", |
| | | schoolName: "", |
| | | enrollTime: "", |
| | | graduateTime: "", |
| | | major: "", |
| | | academicDegree: "", |
| | | degree: "", |
| | | }); |
| | | |
| | | const createEmptyWork = () => ({ |
| | | company: "", |
| | | department: "", |
| | | position: "", |
| | | formerCompany: "", |
| | | formerDept: "", |
| | | formerPosition: "", |
| | | startDate: "", |
| | | endDate: "", |
| | | description: "", |
| | | workDesc: "", |
| | | }); |
| | | |
| | | const createEmptyEmergency = () => ({ |
| | | name: "", |
| | | relation: "", |
| | | phone: "", |
| | | address: "", |
| | | contactName: "", |
| | | contactRelation: "", |
| | | contactPhone: "", |
| | | contactAddress: "", |
| | | }); |
| | | |
| | | const createDefaultForm = () => ({ |
| | |
| | | // åºæ¬ä¿¡æ¯ |
| | | staffNo: "", |
| | | staffName: "", |
| | | aliasName: "", |
| | | alias: "", |
| | | phone: "", |
| | | sex: "", |
| | | birthDate: "", |
| | |
| | | email: "", |
| | | currentAddress: "", |
| | | // å¨èä¿¡æ¯ |
| | | jobNo: "", |
| | | staffType: "", |
| | | entryDate: "", |
| | | probationPeriod: undefined, |
| | | regularDate: "", |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | proTerm: undefined, |
| | | positiveDate: "", |
| | | sysDeptId: undefined, |
| | | directLeader: "", |
| | | sysPostId: undefined, |
| | | jobLevel: "", |
| | | basicSalary: undefined, |
| | | // é¶è¡å¡ä¿¡æ¯ |
| | | bankName: "", |
| | | bankCardNo: "", |
| | | // æè²ç»å |
| | | educationList: [createEmptyEducation()], |
| | | staffEducationList: [createEmptyEducation()], |
| | | // å·¥ä½ç»å |
| | | workExperienceList: [createEmptyWork()], |
| | | staffWorkExperienceList: [createEmptyWork()], |
| | | // ç´§æ¥è系人 |
| | | emergencyContacts: [createEmptyEmergency()], |
| | | emergencyContact: "", |
| | | emergencyContactPhone: "", |
| | | // è§è² |
| | | roleIds: [], |
| | | staffEmergencyContactList: [createEmptyEmergency()], |
| | | // è§è²ï¼åéï¼ |
| | | roleId: undefined, |
| | | // ææéä»¶ï¼ä»
å端å±ç¤ºï¼ |
| | | attachments: [], |
| | | }); |
| | |
| | | birthDate: [ |
| | | { required: true, message: "è¯·éæ©åºçæ¥æ", trigger: "change" }, |
| | | ], |
| | | jobNo: [{ required: true, message: "请è¾å
¥å·¥å·", trigger: "blur" }], |
| | | staffType: [ |
| | | { required: true, message: "è¯·éæ©å工类å", trigger: "change" }, |
| | | ], |
| | | entryDate: [ |
| | | contractStartTime: [ |
| | | { required: true, message: "è¯·éæ©å
¥èæ¥æ", trigger: "change" }, |
| | | ], |
| | | contractEndTime: [ |
| | | { required: true, message: "è¯·éæ©ååç»ææ¥æ", trigger: "change" }, |
| | | ], |
| | | sysDeptId: [ |
| | | { required: true, message: "è¯·éæ©é¨é¨", trigger: "change" }, |
| | | ], |
| | | roleIds: [ |
| | | { |
| | | required: true, |
| | | type: "array", |
| | | min: 1, |
| | | message: "请è³å°éæ©ä¸ä¸ªè§è²", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | roleId: [{ required: true, message: "è¯·éæ©è§è²", trigger: "change" }], |
| | | }, |
| | | postOptions: [], |
| | | deptOptions: [], |
| | |
| | | }); |
| | | } |
| | | |
| | | const syncEmergencyToLegacyField = () => { |
| | | const first = form.value.emergencyContacts?.[0]; |
| | | form.value.emergencyContact = first?.name || ""; |
| | | form.value.emergencyContactPhone = first?.phone || ""; |
| | | }; |
| | | |
| | | const openDialog = (type, row) => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | |
| | | ...form.value, |
| | | ...d, |
| | | }); |
| | | if (!Array.isArray(form.value.educationList) || !form.value.educationList.length) { |
| | | form.value.educationList = [createEmptyEducation()]; |
| | | if ( |
| | | !Array.isArray(form.value.staffEducationList) || |
| | | !form.value.staffEducationList.length |
| | | ) { |
| | | form.value.staffEducationList = [createEmptyEducation()]; |
| | | } |
| | | if ( |
| | | !Array.isArray(form.value.workExperienceList) || |
| | | !form.value.workExperienceList.length |
| | | !Array.isArray(form.value.staffWorkExperienceList) || |
| | | !form.value.staffWorkExperienceList.length |
| | | ) { |
| | | form.value.workExperienceList = [createEmptyWork()]; |
| | | form.value.staffWorkExperienceList = [createEmptyWork()]; |
| | | } |
| | | if ( |
| | | !Array.isArray(form.value.emergencyContacts) || |
| | | !form.value.emergencyContacts.length |
| | | !Array.isArray(form.value.staffEmergencyContactList) || |
| | | !form.value.staffEmergencyContactList.length |
| | | ) { |
| | | form.value.emergencyContacts = [createEmptyEmergency()]; |
| | | form.value.staffEmergencyContactList = [createEmptyEmergency()]; |
| | | } |
| | | if (form.value.sysPostId === 0) { |
| | | form.value.sysPostId = undefined; |
| | |
| | | if (!form.value.sysDeptId) { |
| | | form.value.sysDeptId = undefined; |
| | | } |
| | | syncEmergencyToLegacyField(); |
| | | // å
¼å®¹å端å¯è½ä»ä½¿ç¨ roleIds æ°ç» |
| | | form.value.roleIds = form.value.roleId ? [form.value.roleId] : []; |
| | | formRef.value?.validate((valid) => { |
| | | if (valid) { |
| | | if (operationType.value === "add") { |
| | |
| | | prop: "staffName", |
| | | }, |
| | | { |
| | | label: "å«å", |
| | | prop: "alias", |
| | | }, |
| | | { |
| | | label: "ææº", |
| | | prop: "phone", |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "æ§å«", |
| | | prop: "sex", |
| | | }, |
| | | { |
| | | label: "æ·ç±ä½å", |
| | | prop: "nativePlace", |
| | | }, |
| | | { |
| | | label: "é¨é¨", |
| | | prop: "deptName", |
| | | }, |
| | | { |
| | | label: "å²ä½", |
| | | prop: "postJob", |
| | | }, |
| | | { |
| | | label: "ç°ä½å", |
| | | prop: "adress", |
| | | width:200 |
| | | }, |
| | | { |
| | | label: "第ä¸å¦å", |
| | | prop: "firstStudy", |
| | | }, |
| | | { |
| | | label: "ä¸ä¸", |
| | | prop: "profession", |
| | | width:100 |
| | | label: "åºçæ¥æ", |
| | | prop: "birthDate", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "å¹´é¾", |
| | | prop: "age", |
| | | }, |
| | | { |
| | | label: "èç³»çµè¯", |
| | | prop: "phone", |
| | | width:150 |
| | | label: "ç±è´¯", |
| | | prop: "nativePlace", |
| | | }, |
| | | { |
| | | label: "ç´§æ¥è系人", |
| | | prop: "emergencyContact", |
| | | width: 120 |
| | | label: "æ°æ", |
| | | prop: "nation", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "ç´§æ¥è系人çµè¯", |
| | | prop: "emergencyContactPhone", |
| | | width:150 |
| | | }, |
| | | // { |
| | | // label: "ååå¹´é", |
| | | // prop: "contractTerm", |
| | | // }, |
| | | // { |
| | | // label: "ååå¼å§æ¥æ", |
| | | // prop: "contractStartTime", |
| | | // width: 120 |
| | | // }, |
| | | { |
| | | label: "ååç»ææ¥æ", |
| | | prop: "contractExpireTime", |
| | | width: 120 |
| | | label: "å©å§»ç¶åµ", |
| | | prop: "maritalStatus", |
| | | width: 100, |
| | | }, |
| | | { |
| | | dataType: "action", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <FormDialog |
| | | v-model="dialogVisible" |
| | | operation-type="edit" |
| | | title="è®¾ç½®åæ¾é¶è¡ä¸ææ°æ®" |
| | | width="640px" |
| | | @close="handleClose" |
| | | @confirm="handleConfirm" |
| | | @cancel="handleCancel" |
| | | > |
| | | <el-form ref="formRef" :model="form" label-position="top"> |
| | | <el-row :gutter="16"> |
| | | <el-col :span="24" style="display: flex; justify-content: end; gap: 10px;margin-bottom: 10px"> |
| | | <el-button type="primary" @click="addBank">æ°å¢é¶è¡</el-button> |
| | | <el-button @click="resetToEmpty">æ¸
空</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table :data="form.banks" border style="width: 100%"> |
| | | <el-table-column label="é¶è¡åç§°" min-width="260"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model="row.bankName" |
| | | placeholder="ä¾å¦ï¼ä¸å½å·¥åé¶è¡" |
| | | clearable |
| | | maxlength="50" |
| | | show-word-limit |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="90" align="center"> |
| | | <template #default="{ $index }"> |
| | | <el-button type="danger" link @click="removeBank($index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="margin-top: 10px; color: #909399; font-size: 12px"> |
| | | æç¤ºï¼è¿éç»´æ¤çæ¯âåæ¾é¶è¡â䏿æ¡éé¡¹æ°æ®ï¼ä¿åå卿°å»º/ç¼è¾å·¥èµè¡¨ä¸å¯éæ©ã |
| | | </div> |
| | | </el-form> |
| | | </FormDialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, reactive, ref, toRefs, watch, getCurrentInstance } from "vue"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { bankAdd, bankDelete, bankList, bankUpdate } from "@/api/personnelManagement/bank.js"; |
| | | |
| | | const emit = defineEmits(["update:modelValue", "close", "saved"]); |
| | | const props = defineProps({ |
| | | modelValue: { type: Boolean, default: false }, |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.modelValue, |
| | | set: (val) => emit("update:modelValue", val), |
| | | }); |
| | | |
| | | const formRef = ref(null); |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | banks: [], |
| | | }, |
| | | }); |
| | | |
| | | const { form } = toRefs(data); |
| | | |
| | | function newKey() { |
| | | return Math.random().toString(36).slice(2); |
| | | } |
| | | |
| | | const addBank = () => { |
| | | form.value.banks.push({ |
| | | _key: newKey(), |
| | | id: undefined, |
| | | bankName: "", |
| | | _originBankName: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeBank = (index) => { |
| | | const row = form.value.banks?.[index]; |
| | | if (!row) return; |
| | | // æªè½åºçè¡ï¼ç´æ¥ç§»é¤ |
| | | if (!row.id) { |
| | | form.value.banks.splice(index, 1); |
| | | return; |
| | | } |
| | | // å·²è½åºï¼è°ç¨å端å é¤ |
| | | bankDelete([row.id]).then(() => { |
| | | proxy?.$modal?.msgSuccess?.("å 餿å"); |
| | | form.value.banks.splice(index, 1); |
| | | emit("saved"); |
| | | }); |
| | | }; |
| | | |
| | | const resetToEmpty = () => { |
| | | if (!form.value.banks?.length) return; |
| | | const ids = form.value.banks.map((b) => b?.id).filter(Boolean); |
| | | // è¥å
¨é¨æ¯æªä¿åè¡ï¼åä»
æ¸
空æ¬å° |
| | | if (!ids.length) { |
| | | form.value.banks = []; |
| | | return; |
| | | } |
| | | proxy?.$modal |
| | | ?.confirm?.("ç¡®å®æ¸
空ææé¶è¡åï¼") |
| | | .then(() => bankDelete(ids)) |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess?.("æ¸
空æå"); |
| | | form.value.banks = []; |
| | | emit("saved"); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | const loadSetting = () => { |
| | | return bankList().then((res) => { |
| | | const list = Array.isArray(res?.data) ? res.data : []; |
| | | form.value.banks = list.map((b) => ({ |
| | | _key: newKey(), |
| | | id: b?.id, |
| | | bankName: b?.bankName ?? "", |
| | | _originBankName: b?.bankName ?? "", |
| | | })); |
| | | }); |
| | | }; |
| | | |
| | | const openDialog = () => { |
| | | loadSetting(); |
| | | }; |
| | | |
| | | watch( |
| | | () => dialogVisible.value, |
| | | (val) => { |
| | | if (val) openDialog(); |
| | | } |
| | | ); |
| | | |
| | | const handleConfirm = () => { |
| | | const names = (form.value.banks || []) |
| | | .map((b) => (b?.bankName == null ? "" : String(b.bankName).trim())) |
| | | .filter((n) => n !== ""); |
| | | const unique = Array.from(new Set(names)); |
| | | if (!unique.length) { |
| | | proxy?.$modal?.msgWarning?.("请è³å°æ°å¢ä¸ä¸ªé¶è¡é项"); |
| | | return; |
| | | } |
| | | if (unique.length !== names.length) { |
| | | proxy?.$modal?.msgWarning?.("é¶è¡åç§°ä¸å¯éå¤"); |
| | | return; |
| | | } |
| | | |
| | | const rows = form.value.banks.map((b) => ({ |
| | | ...b, |
| | | bankName: b?.bankName == null ? "" : String(b.bankName).trim(), |
| | | })); |
| | | |
| | | const toAdd = rows.filter((b) => !b.id && b.bankName); |
| | | const toUpdate = rows.filter((b) => b.id && b.bankName && b.bankName !== (b._originBankName ?? "")); |
| | | |
| | | Promise.all([ |
| | | ...toAdd.map((b) => bankAdd({ bankName: b.bankName })), |
| | | ...toUpdate.map((b) => bankUpdate({ id: b.id, bankName: b.bankName })), |
| | | ]) |
| | | .then(() => loadSetting()) |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess?.("ä¿åæå"); |
| | | dialogVisible.value = false; |
| | | emit("saved", { options: unique }); |
| | | }); |
| | | }; |
| | | |
| | | const handleCancel = () => { |
| | | dialogVisible.value = false; |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | | emit("close"); |
| | | }; |
| | | |
| | | defineExpose({ openDialog }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | | |
| | |
| | | <el-form ref="formRef" :model="form" :rules="rules" label-position="top"> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="å·¥èµä¸»é¢" prop="title"> |
| | | <el-form-item label="å·¥èµä¸»é¢" prop="salaryTitle"> |
| | | <el-input |
| | | v-model="form.title" |
| | | v-model="form.salaryTitle" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | maxlength="20" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="éæ©å·¥èµæä»½" prop="payMonth"> |
| | | <el-form-item label="éæ©å·¥èµæä»½" prop="salaryMonth"> |
| | | <el-date-picker |
| | | v-model="form.payMonth" |
| | | v-model="form.salaryMonth" |
| | | type="month" |
| | | value-format="YYYY-MM" |
| | | format="YYYY-MM" |
| | |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æ¯ä»é¶è¡" prop="payBank"> |
| | | <el-select |
| | | v-model="form.payBank" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | filterable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="b in bankOptions" |
| | | :key="b" |
| | | :label="b" |
| | | :value="b" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="åå·¥å§å" prop="staffName" minWidth="100" /> |
| | | <el-table-column label="è§è²" prop="roleName" minWidth="100" /> |
| | | <el-table-column label="é¨é¨" prop="deptName" minWidth="100" /> |
| | | <el-table-column label="åºæ¬å·¥èµ" minWidth="110"> |
| | | <template #default="{ row }"> |
| | |
| | | <el-table-column label="计件工èµ" minWidth="110"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model.number="row.pieceworkSalary" |
| | | v-model.number="row.pieceSalary" |
| | | type="number" |
| | | placeholder="0" |
| | | size="small" |
| | | @input="row.pieceworkSalary = parseNum(row.pieceworkSalary)" |
| | | @input="row.pieceSalary = parseNum(row.pieceSalary)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column label="社ä¿ä¸ªäºº" minWidth="110"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model.number="row.socialSecurityIndividuals" |
| | | v-model.number="row.socialPersonal" |
| | | type="number" |
| | | placeholder="0" |
| | | size="small" |
| | | @input="row.socialSecurityIndividuals = parseNum(row.socialSecurityIndividuals)" |
| | | @input="row.socialPersonal = parseNum(row.socialPersonal)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å
¬ç§¯é个人" minWidth="120"> |
| | | <template #default="{ row }"> |
| | | <el-input |
| | | v-model.number="row.providentFundIndividuals" |
| | | v-model.number="row.fundPersonal" |
| | | type="number" |
| | | placeholder="0" |
| | | size="small" |
| | | @input="row.providentFundIndividuals = parseNum(row.providentFundIndividuals)" |
| | | @input="row.fundPersonal = parseNum(row.fundPersonal)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import { ArrowUp } from "@element-plus/icons-vue"; |
| | | import { listDept } from "@/api/system/dept.js"; |
| | | import { staffOnJobList } from "@/api/personnelManagement/monthlyStatistics.js"; |
| | | import { bankList } from "@/api/personnelManagement/bank.js"; |
| | | import { |
| | | monthlyStatisticsAdd, |
| | | monthlyStatisticsUpdate, |
| | | monthlyStatisticsGet, |
| | | } from "@/api/personnelManagement/monthlyStatistics.js"; |
| | | staffSalaryMainAdd, |
| | | staffSalaryMainUpdate, |
| | | staffSalaryMainCalculateSalary, |
| | | } from "@/api/personnelManagement/staffSalaryMain.js"; |
| | | |
| | | const emit = defineEmits(["update:modelValue", "close"]); |
| | | const props = defineProps({ |
| | |
| | | const deptStaffTree = ref([]); |
| | | const employeeList = ref([]); |
| | | const selectedEmployees = ref([]); |
| | | const bankOptions = ref([]); |
| | | const taxTableData = ref([ |
| | | { level: 1, range: "ä¸è¶
è¿36000å
", rate: 3, quickDeduction: 0 }, |
| | | { level: 2, range: "è¶
è¿36000-144000å
", rate: 10, quickDeduction: 2520 }, |
| | |
| | | const data = reactive({ |
| | | form: { |
| | | id: undefined, |
| | | title: "", |
| | | salaryTitle: "", |
| | | deptId: undefined, |
| | | payMonth: "", |
| | | salaryMonth: "", |
| | | remark: "", |
| | | payBank: "", |
| | | }, |
| | | rules: { |
| | | title: [{ required: true, message: "请è¾å
¥å·¥èµä¸»é¢", trigger: "blur" }], |
| | | salaryTitle: [{ required: true, message: "请è¾å
¥å·¥èµä¸»é¢", trigger: "blur" }], |
| | | deptId: [{ required: true, message: "è¯·éæ©é¨é¨", trigger: "change" }], |
| | | payMonth: [{ required: true, message: "è¯·éæ©å·¥èµæä»½", trigger: "change" }], |
| | | salaryMonth: [{ required: true, message: "è¯·éæ©å·¥èµæä»½", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | const loadBankOptions = () => { |
| | | return bankList().then((res) => { |
| | | const list = Array.isArray(res?.data) ? res.data : []; |
| | | bankOptions.value = list |
| | | .map((b) => (b?.bankName == null ? "" : String(b.bankName).trim())) |
| | | .filter((v) => v !== ""); |
| | | }); |
| | | }; |
| | | |
| | | // æå¹³åé¨é¨æ ä¾ä¸æä½¿ç¨ |
| | | function flattenDept(tree, list = []) { |
| | |
| | | const openDialog = (type, row) => { |
| | | nextTick(() => { |
| | | loadDeptOptions(); |
| | | loadBankOptions(); |
| | | employeeList.value = []; |
| | | Object.assign(form.value, { |
| | | id: undefined, |
| | | title: "", |
| | | salaryTitle: "", |
| | | deptId: undefined, |
| | | payMonth: "", |
| | | salaryMonth: "", |
| | | remark: "", |
| | | payBank: "", |
| | | }); |
| | | // ç¼è¾ï¼å表页已è¿åä¸»è¡¨åæ®µï¼è¿éåªååæ¾ï¼æç»ç±âçæå·¥èµè¡¨/计ç®å·¥èµâå¾å°ï¼ |
| | | if (type === "edit" && row?.id) { |
| | | monthlyStatisticsGet(row.id).then((res) => { |
| | | const d = res.data || {}; |
| | | form.value.id = d.id; |
| | | form.value.title = d.title ?? d.payDateStr ?? ""; |
| | | form.value.deptId = d.deptId; |
| | | form.value.payMonth = d.payMonth ?? d.payDate ?? d.payDateStr ?? ""; |
| | | form.value.remark = d.remark ?? ""; |
| | | employeeList.value = (d.detailList || d.employeeList || []).map((e) => ({ |
| | | ...e, |
| | | basicSalary: parseNum(e.basicSalary), |
| | | pieceworkSalary: parseNum(e.pieceworkSalary), |
| | | hourlySalary: parseNum(e.hourlySalary), |
| | | otherIncome: parseNum(e.otherIncome), |
| | | socialSecurityIndividuals: parseNum(e.socialSecurityIndividuals), |
| | | providentFundIndividuals: parseNum(e.providentFundIndividuals), |
| | | })); |
| | | }); |
| | | form.value.id = row.id; |
| | | form.value.salaryTitle = row.salaryTitle ?? ""; |
| | | // deptIds å端æ¯å符串ï¼å¤ä¸ªç¨éå·åéï¼ï¼å½å表å仿¯åé deptId |
| | | form.value.deptId = row.deptIds ? Number(String(row.deptIds).split(",")[0]) : undefined; |
| | | form.value.salaryMonth = row.salaryMonth ?? ""; |
| | | form.value.remark = row.remark ?? ""; |
| | | form.value.payBank = row.payBank ?? ""; |
| | | } |
| | | }); |
| | | }; |
| | |
| | | if (existIds.has(id)) return; |
| | | existIds.add(id); |
| | | employeeList.value.push({ |
| | | staffId: id, |
| | | id: id, |
| | | staffOnJobId: id, |
| | | id, |
| | | staffName: node.label, |
| | | roleName: node.roleName ?? node.role ?? "", |
| | | postName: node.postName ?? node.post ?? "", |
| | | deptName: node.deptName ?? "", |
| | | basicSalary: 0, |
| | | pieceworkSalary: 0, |
| | | pieceSalary: 0, |
| | | hourlySalary: 0, |
| | | otherIncome: 0, |
| | | socialSecurityIndividuals: 0, |
| | | providentFundIndividuals: 0, |
| | | socialPersonal: 0, |
| | | fundPersonal: 0, |
| | | otherDeduct: 0, |
| | | salaryTax: 0, |
| | | grossSalary: 0, |
| | | deductSalary: 0, |
| | | netSalary: 0, |
| | | remark: "", |
| | | }); |
| | | }); |
| | | addPersonVisible.value = false; |
| | |
| | | |
| | | const removeEmployee = (row) => { |
| | | employeeList.value = employeeList.value.filter( |
| | | (e) => (e.staffId || e.id) !== (row.staffId || row.id) |
| | | (e) => (e.staffOnJobId || e.id) !== (row.staffOnJobId || row.id) |
| | | ); |
| | | }; |
| | | |
| | |
| | | proxy.$modal.msgWarning("请å
å¾éè¦å é¤çåå·¥"); |
| | | return; |
| | | } |
| | | const ids = new Set(selectedEmployees.value.map((e) => e.staffId || e.id)); |
| | | const ids = new Set(selectedEmployees.value.map((e) => e.staffOnJobId || e.id)); |
| | | employeeList.value = employeeList.value.filter( |
| | | (e) => !ids.has(e.staffId || e.id) |
| | | (e) => !ids.has(e.staffOnJobId || e.id) |
| | | ); |
| | | }; |
| | | |
| | | const handleGenerate = () => { |
| | | proxy.$modal.msgInfo("çæå·¥èµè¡¨åè½é对æ¥å端"); |
| | | if (!form.value.deptId) { |
| | | proxy.$modal.msgWarning("请å
éæ©é¨é¨"); |
| | | return; |
| | | } |
| | | if (!form.value.salaryMonth) { |
| | | proxy.$modal.msgWarning("请å
éæ©å·¥èµæä»½"); |
| | | return; |
| | | } |
| | | if (!employeeList.value?.length) { |
| | | proxy.$modal.msgWarning("请å
æ°å¢äººå"); |
| | | return; |
| | | } |
| | | const ids = employeeList.value |
| | | .map((e) => e.staffOnJobId ?? e.staffId ?? e.id) |
| | | .filter(Boolean); |
| | | staffSalaryMainCalculateSalary(ids).then((res) => { |
| | | const list = Array.isArray(res?.data) ? res.data : []; |
| | | if (!list.length) { |
| | | proxy.$modal.msgWarning("æªè®¡ç®å°å·¥èµæ°æ®"); |
| | | return; |
| | | } |
| | | employeeList.value = list.map((e) => ({ |
| | | ...e, |
| | | staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id, |
| | | staffName: e.staffName, |
| | | postName: e.postName, |
| | | deptName: e.deptName, |
| | | basicSalary: parseNum(e.basicSalary), |
| | | pieceSalary: parseNum(e.pieceSalary), |
| | | hourlySalary: parseNum(e.hourlySalary), |
| | | otherIncome: parseNum(e.otherIncome), |
| | | socialPersonal: parseNum(e.socialPersonal), |
| | | fundPersonal: parseNum(e.fundPersonal), |
| | | otherDeduct: parseNum(e.otherDeduct), |
| | | salaryTax: parseNum(e.salaryTax), |
| | | grossSalary: parseNum(e.grossSalary), |
| | | deductSalary: parseNum(e.deductSalary), |
| | | netSalary: parseNum(e.netSalary), |
| | | remark: e.remark ?? "", |
| | | })); |
| | | proxy.$modal.msgSuccess("çææå"); |
| | | }); |
| | | }; |
| | | |
| | | const handleExport = () => { |
| | |
| | | if (!valid) return; |
| | | const payload = { |
| | | ...form.value, |
| | | deptIds: form.value.deptId ? String(form.value.deptId) : "", |
| | | detailList: employeeList.value.map((e) => ({ |
| | | staffId: e.staffId ?? e.id, |
| | | staffOnJobId: e.staffOnJobId ?? e.staffId ?? e.id, |
| | | staffName: e.staffName, |
| | | basicSalary: parseNum(e.basicSalary), |
| | | pieceworkSalary: parseNum(e.pieceworkSalary), |
| | | pieceSalary: parseNum(e.pieceSalary), |
| | | hourlySalary: parseNum(e.hourlySalary), |
| | | otherIncome: parseNum(e.otherIncome), |
| | | socialSecurityIndividuals: parseNum(e.socialSecurityIndividuals), |
| | | providentFundIndividuals: parseNum(e.providentFundIndividuals), |
| | | socialPersonal: parseNum(e.socialPersonal), |
| | | fundPersonal: parseNum(e.fundPersonal), |
| | | otherDeduct: parseNum(e.otherDeduct), |
| | | salaryTax: parseNum(e.salaryTax), |
| | | grossSalary: parseNum(e.grossSalary), |
| | | deductSalary: parseNum(e.deductSalary), |
| | | netSalary: parseNum(e.netSalary), |
| | | remark: e.remark ?? "", |
| | | })), |
| | | }; |
| | | if (props.operationType === "add") { |
| | | monthlyStatisticsAdd(payload).then(() => { |
| | | staffSalaryMainAdd({ ...payload, status: 1 }).then(() => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | closeDia(); |
| | | }); |
| | | } else { |
| | | monthlyStatisticsUpdate(payload).then(() => { |
| | | staffSalaryMainUpdate(payload).then(() => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | closeDia(); |
| | | }); |
| | |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | <span class="search_title ml10">åæ®ç¶æï¼</span> |
| | | <el-select |
| | | v-model="searchForm.documentStatus" |
| | | placeholder="è¯·éæ©åæ®ç¶æ" |
| | | clearable |
| | | style="width: 180px" |
| | | > |
| | | <el-option label="è稿" value="draft" /> |
| | | <el-option label="å·²æäº¤" value="submitted" /> |
| | | <el-option label="å·²å®¡æ ¸" value="approved" /> |
| | | <span class="search_title ml10">ç¶æï¼</span> |
| | | <el-select v-model="searchForm.status" placeholder="è¯·éæ©ç¶æ" clearable style="width: 180px"> |
| | | <el-option label="è稿" :value="1" /> |
| | | <el-option label="å®¡æ ¸æªéè¿" :value="2" /> |
| | | <el-option label="å¾
å®¡æ ¸" :value="3" /> |
| | | <el-option label="å¾
åæ¾" :value="4" /> |
| | | <el-option label="已忾" :value="5" /> |
| | | </el-select> |
| | | <span class="search_title ml10">å·¥èµæä»½ï¼</span> |
| | | <el-date-picker |
| | | v-model="searchForm.payMonth" |
| | | v-model="searchForm.salaryMonth" |
| | | type="month" |
| | | value-format="YYYY-MM" |
| | | format="YYYY-MM" |
| | |
| | | clearable |
| | | @change="handleQuery" |
| | | /> |
| | | <span class="search_title ml10">å®¡æ ¸ç¶æï¼</span> |
| | | <el-select |
| | | v-model="searchForm.approvalStatus" |
| | | placeholder="è¯·éæ©å®¡æ ¸ç¶æ" |
| | | clearable |
| | | style="width: 180px" |
| | | > |
| | | <el-option label="å¾
å®¡æ ¸" value="pending" /> |
| | | <el-option label="å·²éè¿" value="passed" /> |
| | | <el-option label="已驳å" value="rejected" /> |
| | | </el-select> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px"> |
| | | æç´¢ |
| | | </el-button> |
| | |
| | | <div style="margin-bottom: 10px"> |
| | | <el-button type="primary" @click="openForm('add')">æ°å»ºå·¥èµè¡¨</el-button> |
| | | <el-button @click="handleDelete">å é¤</el-button> |
| | | <el-button @click="openBankSetting">设置é¶è¡</el-button> |
| | | <el-button @click="handleExport">导åº</el-button> |
| | | </div> |
| | | <PIMTable |
| | |
| | | ref="formDiaRef" |
| | | @close="handleQuery" |
| | | /> |
| | | <bank-setting-dia |
| | | v-model="bankDialogVisible" |
| | | ref="bankDiaRef" |
| | | @saved="handleBankSaved" |
| | | /> |
| | | <el-dialog v-model="issueDialogVisible" title="å·¥èµåæ¾" width="720px"> |
| | | <el-form label-position="top"> |
| | | <el-form-item label="åæ¾é¶è¡" required> |
| | | <el-select |
| | | v-model="issueForm.bank" |
| | | placeholder="è¯·éæ©åæ¾é¶è¡" |
| | | clearable |
| | | filterable |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="b in issueBankOptions" :key="b" :label="b" :value="b" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="issueDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" :loading="issueLoading" @click="confirmIssue"> |
| | | ç¡®å® |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="auditDialogVisible" title="å·¥èµå®¡æ ¸" width="720px"> |
| | | <el-form label-position="top"> |
| | | <el-form-item label="å®¡æ ¸ç»æ" required> |
| | | <el-radio-group v-model="auditForm.result"> |
| | | <el-radio :value="4">éè¿</el-radio> |
| | | <el-radio :value="2">ä¸éè¿</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="auditDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" :loading="auditLoading" @click="confirmAudit"> |
| | | ç¡®å® |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { |
| | | onMounted, |
| | | computed, |
| | | ref, |
| | | reactive, |
| | | toRefs, |
| | |
| | | nextTick, |
| | | } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import Cookies from "js-cookie"; |
| | | import FormDia from "./components/formDia.vue"; |
| | | import BankSettingDia from "./components/bankSettingDia.vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { bankList } from "@/api/personnelManagement/bank.js"; |
| | | import { |
| | | monthlyStatisticsListPage, |
| | | monthlyStatisticsDelete, |
| | | } from "@/api/personnelManagement/monthlyStatistics.js"; |
| | | staffSalaryMainListPage, |
| | | staffSalaryMainDelete, |
| | | staffSalaryMainUpdate, |
| | | } from "@/api/personnelManagement/staffSalaryMain.js"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | title: "", |
| | | documentStatus: "", |
| | | payMonth: "", |
| | | approvalStatus: "", |
| | | status: "", |
| | | salaryMonth: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | const tableColumn = ref([ |
| | | { label: "å·¥èµä¸»é¢", prop: "title", minWidth: 140 }, |
| | | { label: "å·¥èµæä»½", prop: "payMonth", width: 120 }, |
| | | { label: "åæ®ç¶æ", prop: "documentStatusName", width: 100 }, |
| | | { label: "å®¡æ ¸ç¶æ", prop: "approvalStatusName", width: 100 }, |
| | | { label: "å·¥èµæ»é¢", prop: "totalAmount", width: 120 }, |
| | | { label: "æ¯ä»é¶è¡", prop: "paymentBank", width: 120 }, |
| | | { label: "åæ¾æ¶é´", prop: "issueTime", width: 160 }, |
| | | { label: "审æ¹äººå", prop: "approver", width: 100 }, |
| | | { label: "å·¥èµä¸»é¢", prop: "salaryTitle", minWidth: 140 }, |
| | | { label: "å·¥èµæä»½", prop: "salaryMonth", width: 120 }, |
| | | { label: "ç¶æ", prop: "statusName", width: 110 }, |
| | | { label: "å·¥èµæ»é¢", prop: "totalSalary", width: 120 }, |
| | | { label: "æ¯ä»é¶è¡", prop: "payBank", width: 120 }, |
| | | { label: "å®¡æ ¸äºº", prop: "auditUserName", width: 110 }, |
| | | { label: "夿³¨", prop: "remark", minWidth: 120 }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 120, |
| | | width: 180, |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | showHide: (row) => Number(row?.status) === 1 || Number(row?.status) === 2, |
| | | clickFun: (row) => openForm("edit", row), |
| | | }, |
| | | { |
| | | name: "å®¡æ ¸", |
| | | type: "text", |
| | | showHide: (row) => Number(row?.status) === 3, |
| | | clickFun: (row) => openAudit(row), |
| | | }, |
| | | { |
| | | name: "åæ¾", |
| | | type: "text", |
| | | showHide: (row) => Number(row?.status) === 4, |
| | | clickFun: (row) => openIssue(row), |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | const operationType = ref("add"); |
| | | const currentRow = ref({}); |
| | | const { proxy } = getCurrentInstance(); |
| | | const bankSetting = ref({}); |
| | | const bankDialogVisible = ref(false); |
| | | const bankDiaRef = ref(null); |
| | | const issueDialogVisible = ref(false); |
| | | const issueLoading = ref(false); |
| | | const issueRow = ref(null); |
| | | const issueForm = reactive({ bank: "" }); |
| | | const auditDialogVisible = ref(false); |
| | | const auditLoading = ref(false); |
| | | const auditRow = ref(null); |
| | | const auditForm = reactive({ result: 4 }); // 4=éè¿(å¾
åæ¾) 2=ä¸éè¿ |
| | | |
| | | const issueBankOptions = computed(() => { |
| | | const options = Array.isArray(bankSetting.value?.options) ? bankSetting.value.options : []; |
| | | return options |
| | | .map((v) => (v == null ? "" : String(v).trim())) |
| | | .filter((v) => v !== ""); |
| | | }); |
| | | |
| | | const statusName = (s) => { |
| | | const n = Number(s); |
| | | return ( |
| | | { |
| | | 1: "è稿", |
| | | 2: "å®¡æ ¸æªéè¿", |
| | | 3: "å¾
å®¡æ ¸", |
| | | 4: "å¾
åæ¾", |
| | | 5: "已忾", |
| | | }[n] || "-" |
| | | ); |
| | | }; |
| | | |
| | | const loadBankSetting = () => { |
| | | return bankList().then((res) => { |
| | | const list = Array.isArray(res?.data) ? res.data : []; |
| | | const options = list |
| | | .map((b) => (b?.bankName == null ? "" : String(b.bankName).trim())) |
| | | .filter((v) => v !== ""); |
| | | bankSetting.value = { options, defaultBank: "" }; |
| | | }); |
| | | }; |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | |
| | | |
| | | const handleReset = () => { |
| | | searchForm.value.title = ""; |
| | | searchForm.value.documentStatus = ""; |
| | | searchForm.value.payMonth = ""; |
| | | searchForm.value.approvalStatus = ""; |
| | | searchForm.value.status = ""; |
| | | searchForm.value.salaryMonth = ""; |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | monthlyStatisticsListPage({ |
| | | staffSalaryMainListPage({ |
| | | ...searchForm.value, |
| | | current: page.current, |
| | | size: page.size, |
| | | }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | const records = res.data?.records ?? []; |
| | | const records = res.data?.records ?? res.data?.list ?? []; |
| | | // å
¼å®¹åç«¯åæ®µï¼è¥æ¥å£ä»è¿åå°è´¦ç»æï¼å¯å¨æ¤åæ å° |
| | | tableData.value = records.map((item) => ({ |
| | | ...item, |
| | | title: item.title ?? item.payDateStr ?? "-", |
| | | payMonth: item.payMonth ?? item.payDateStr ?? item.payDate ?? "-", |
| | | documentStatusName: item.documentStatusName ?? "-", |
| | | approvalStatusName: item.approvalStatusName ?? "-", |
| | | totalAmount: item.totalAmount ?? item.actualWages ?? "-", |
| | | paymentBank: item.paymentBank ?? "-", |
| | | issueTime: item.issueTime ?? item.createTime ?? "-", |
| | | approver: item.approver ?? "-", |
| | | salaryTitle: item.salaryTitle ?? "-", |
| | | salaryMonth: item.salaryMonth ?? "-", |
| | | statusName: statusName(item.status), |
| | | totalSalary: item.totalSalary ?? "-", |
| | | payBank: (item.payBank == null ? "" : String(item.payBank).trim()) || "-", |
| | | auditUserName: item.auditUserName ?? "-", |
| | | })); |
| | | page.total = res.data?.total ?? 0; |
| | | page.total = res.data?.total ?? res.data?.count ?? 0; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | |
| | | }); |
| | | }; |
| | | |
| | | const openBankSetting = () => { |
| | | bankDialogVisible.value = true; |
| | | }; |
| | | |
| | | const openAudit = (row) => { |
| | | auditRow.value = row || null; |
| | | auditForm.result = 4; |
| | | auditDialogVisible.value = true; |
| | | }; |
| | | |
| | | const openIssue = (row) => { |
| | | if (!issueBankOptions.value?.length) { |
| | | proxy?.$modal?.msgWarning?.("请å
å¨â设置é¶è¡âä¸ç»´æ¤åæ¾é¶è¡é项"); |
| | | return; |
| | | } |
| | | issueRow.value = row || null; |
| | | const current = row?.payBank && row.payBank !== "-" ? String(row.payBank).trim() : ""; |
| | | issueForm.bank = current; |
| | | issueDialogVisible.value = true; |
| | | }; |
| | | |
| | | const confirmAudit = () => { |
| | | const row = auditRow.value; |
| | | if (!row?.id) { |
| | | auditDialogVisible.value = false; |
| | | return; |
| | | } |
| | | const username = Cookies.get("username") || ""; |
| | | const userIdRaw = Cookies.get("userId"); |
| | | const auditUserId = userIdRaw ? Number(userIdRaw) : undefined; |
| | | auditLoading.value = true; |
| | | staffSalaryMainUpdate({ |
| | | id: row.id, |
| | | status: Number(auditForm.result) === 2 ? 2 : 4, |
| | | auditUserId, |
| | | auditUserName: username, |
| | | }) |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess?.("å®¡æ ¸æå"); |
| | | auditDialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .finally(() => { |
| | | auditLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const confirmIssue = () => { |
| | | const bank = issueForm.bank ? String(issueForm.bank).trim() : ""; |
| | | if (!bank) { |
| | | proxy?.$modal?.msgWarning?.("è¯·éæ©åæ¾é¶è¡"); |
| | | return; |
| | | } |
| | | const row = issueRow.value; |
| | | if (!row?.id) { |
| | | issueDialogVisible.value = false; |
| | | return; |
| | | } |
| | | issueLoading.value = true; |
| | | staffSalaryMainUpdate({ |
| | | id: row.id, |
| | | payBank: bank, |
| | | status: 5, |
| | | }) |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess?.("åæ¾æå"); |
| | | issueDialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .finally(() => { |
| | | issueLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const handleBankSaved = () => { |
| | | loadBankSetting(); |
| | | getList(); |
| | | }; |
| | | |
| | | const handleDelete = () => { |
| | | if (!selectedRows.value?.length) { |
| | | proxy.$modal.msgWarning("è¯·éæ©è¦å é¤çæ°æ®"); |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | monthlyStatisticsDelete(ids).then(() => { |
| | | staffSalaryMainDelete(ids).then(() => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | loadBankSetting(); |
| | | getList(); |
| | | }); |
| | | </script> |
| | |
| | | <el-col :span="8"> |
| | | <el-form-item label="éç¨äººåï¼" prop="deptIds"> |
| | | <div class="dept-checkbox-wrap"> |
| | | <el-checkbox-group v-model="form.deptIds"> |
| | | <el-checkbox-group |
| | | v-model="form.deptIds" |
| | | :disabled="isDetail" |
| | | > |
| | | <div |
| | | v-for="dept in deptList" |
| | | :key="dept.deptId" |
| | |
| | | <el-icon class="card-collapse"><ArrowUp /></el-icon> |
| | | </template> |
| | | <el-form-item label="æ¹æ¡æ é¢ï¼" prop="title"> |
| | | <el-input v-model="form.title" placeholder="请è¾å
¥" clearable /> |
| | | <el-input |
| | | v-model="form.title" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :disabled="isDetail" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨ï¼" prop="remark"> |
| | | <el-input |
| | |
| | | :rows="2" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :disabled="isDetail" |
| | | /> |
| | | </el-form-item> |
| | | </el-card> |
| | |
| | | <el-card class="form-card" shadow="never"> |
| | | <template #header> |
| | | <span class="card-title"><span class="card-title-line">|</span> ä¿é©ç±»å</span> |
| | | <el-button type="primary" size="small" @click="addInsuranceBenefit"> |
| | | <el-button |
| | | v-if="!isDetail" |
| | | type="primary" |
| | | size="small" |
| | | @click="addInsuranceBenefit" |
| | | > |
| | | æ·»å ä¿é©ç¦å© |
| | | </el-button> |
| | | </template> |
| | |
| | | <div class="insurance-benefit-title"> |
| | | ä¿é©ç¦å©{{ index + 1 }} |
| | | <el-button |
| | | v-if="form.insuranceBenefits.length > 1" |
| | | v-if="!isDetail && form.insuranceBenefits.length > 1" |
| | | type="danger" |
| | | link |
| | | size="small" |
| | |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | | :disabled="isDetail" |
| | | > |
| | | <el-option |
| | | v-for="opt in insuranceTypeOptions" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼´è´¹åºæ°ï¼" label-width="100px"> |
| | | <div class="checkbox-group-inline"> |
| | | <el-checkbox v-model="item.baseOnSalary">æ ¹æ®åºæ¬å·¥èµç¼´çº³</el-checkbox> |
| | | <el-checkbox v-model="item.useBasicSalary">è°ç¨åºæ¬å·¥èµ</el-checkbox> |
| | | <div class="base-salary-wrap"> |
| | | <el-input |
| | | v-model="item.paymentBase" |
| | | placeholder="æ ¹æ®åºæ¬å·¥èµç¼´çº³" |
| | | clearable |
| | | style="width: 120px" |
| | | type="number" |
| | | :disabled="isDetail || item.useBasicSalary" |
| | | @input="handlePaymentBaseInput(item)" |
| | | /> |
| | | <el-checkbox |
| | | v-model="item.useBasicSalary" |
| | | @change="handleUseBasicSalaryChange(item)" |
| | | :disabled="isDetail" |
| | | > |
| | | è°ç¨åºæ¬å·¥èµ |
| | | </el-checkbox> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴费æ¯ä¾ï¼" label-width="100px"> |
| | |
| | | clearable |
| | | style="width: 100px" |
| | | type="number" |
| | | :disabled="isDetail" |
| | | /> |
| | | <span class="ratio-unit">(%)</span> |
| | | <span class="ratio-plus">+</span> |
| | |
| | | clearable |
| | | style="width: 100px" |
| | | type="number" |
| | | :disabled="isDetail" |
| | | /> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import { ref, reactive, toRefs, getCurrentInstance, nextTick, computed } from "vue"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { ArrowUp } from "@element-plus/icons-vue"; |
| | | import { listDept } from "@/api/system/dept.js"; |
| | | import { |
| | | socialSecurityInfo, |
| | | socialSecurityAdd, |
| | | socialSecurityUpdate, |
| | | } from "@/api/personnelManagement/socialSecuritySet.js"; |
| | | import { socialSecurityAdd, socialSecurityUpdate } from "@/api/personnelManagement/socialSecuritySet.js"; |
| | | |
| | | const emit = defineEmits(["close"]); |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | const formRef = ref(null); |
| | | const deptList = ref([]); |
| | | |
| | | const isDetail = computed(() => operationType.value === "detail"); |
| | | |
| | | const dialogTitle = () => |
| | | operationType.value === "add" ? "æ°å¢æ¹æ¡" : "ç¼è¾æ¹æ¡"; |
| | | operationType.value === "add" |
| | | ? "æ°å¢æ¹æ¡" |
| | | : operationType.value === "edit" |
| | | ? "ç¼è¾æ¹æ¡" |
| | | : "æ¹æ¡è¯¦æ
"; |
| | | |
| | | // ä¿é©ç±»åé项ï¼å¯æåå
¸æ¿æ¢ï¼ |
| | | const insuranceTypeOptions = [ |
| | | { label: "å
»èä¿é©", value: "pension" }, |
| | | { label: "å»çä¿é©", value: "medical" }, |
| | | { label: "失ä¸ä¿é©", value: "unemployment" }, |
| | | { label: "工伤ä¿é©", value: "work_injury" }, |
| | | { label: "çè²ä¿é©", value: "maternity" }, |
| | | { label: "å
»èä¿é©", value: "å
»èä¿é©" }, |
| | | { label: "å»çä¿é©", value: "å»çä¿é©" }, |
| | | { label: "失ä¸ä¿é©", value: "失ä¸ä¿é©" }, |
| | | { label: "工伤ä¿é©", value: "工伤ä¿é©" }, |
| | | { label: "çè²ä¿é©", value: "çè²ä¿é©" }, |
| | | ]; |
| | | |
| | | const defaultBenefit = () => ({ |
| | | _key: Math.random().toString(36).slice(2), |
| | | insuranceType: "", |
| | | baseOnSalary: false, |
| | | paymentBase: "", |
| | | useBasicSalary: false, |
| | | personalRatio: "", |
| | | personalFixed: "", |
| | |
| | | form.value.insuranceBenefits.splice(index, 1); |
| | | }; |
| | | |
| | | const handleUseBasicSalaryChange = (item) => { |
| | | if (item.useBasicSalary) { |
| | | item.paymentBase = ""; |
| | | } |
| | | }; |
| | | |
| | | const handlePaymentBaseInput = (item) => { |
| | | if (item.paymentBase !== "" && item.paymentBase != null) { |
| | | item.useBasicSalary = false; |
| | | } |
| | | }; |
| | | |
| | | const resetForm = () => { |
| | | form.value = { |
| | | id: undefined, |
| | |
| | | dialogFormVisible.value = true; |
| | | loadDeptList(); |
| | | resetForm(); |
| | | if (type === "edit" && row?.id) { |
| | | socialSecurityInfo(row.id).then((res) => { |
| | | const d = res.data || {}; |
| | | form.value.id = d.id; |
| | | form.value.title = d.title; |
| | | form.value.remark = d.remark ?? ""; |
| | | form.value.deptIds = d.deptIds ?? []; |
| | | form.value.insuranceBenefits = |
| | | (d.insuranceBenefits && d.insuranceBenefits.length) |
| | | ? d.insuranceBenefits.map((b) => ({ |
| | | ...b, |
| | | _key: b._key || Math.random().toString(36).slice(2), |
| | | })) |
| | | : [defaultBenefit()]; |
| | | }); |
| | | if ((type === "edit" || type === "detail") && row) { |
| | | const d = row || {}; |
| | | form.value.id = d.id; |
| | | form.value.title = d.title; |
| | | form.value.remark = d.remark ?? ""; |
| | | // deptIds å端å¯è½æ¯éå·åéåç¬¦ä¸²ææ°ç»ï¼è¿éç»ä¸è½¬ä¸ºæ°ç»å¹¶å°½éè¿åæ°å¼ç±»å |
| | | if (d.deptIds) { |
| | | form.value.deptIds = String(d.deptIds) |
| | | .split(",") |
| | | .filter((v) => v !== "") |
| | | .map((v) => { |
| | | const num = Number(v); |
| | | return Number.isNaN(num) ? v : num; |
| | | }); |
| | | } else { |
| | | form.value.deptIds = []; |
| | | } |
| | | const detailList = d.schemeInsuranceDetailList || []; |
| | | form.value.insuranceBenefits = |
| | | detailList.length > 0 |
| | | ? detailList.map((b) => ({ |
| | | _key: Math.random().toString(36).slice(2), |
| | | insuranceType: b.insuranceType || "", |
| | | paymentBase: b.paymentBase ?? "", |
| | | useBasicSalary: b.useBasicSalary === 2, |
| | | personalRatio: b.personalRatio ?? "", |
| | | personalFixed: b.personalFixed ?? "", |
| | | })) |
| | | : [defaultBenefit()]; |
| | | } |
| | | }; |
| | | |
| | | const submitForm = () => { |
| | | // 详æ
模å¼ä¸ä¸æäº¤ï¼åªå
³éå¼¹çª |
| | | if (operationType.value === "detail") { |
| | | closeDia(); |
| | | return; |
| | | } |
| | | formRef.value?.validate((valid) => { |
| | | if (!valid) return; |
| | | const deptIds = |
| | | Array.isArray(form.value.deptIds) && form.value.deptIds.length |
| | | ? form.value.deptIds.join(",") |
| | | : ""; |
| | | const schemeInsuranceDetailList = (form.value.insuranceBenefits || []).map( |
| | | ({ _key, ...rest }) => ({ |
| | | ...rest, |
| | | useBasicSalary: rest.useBasicSalary ? 2 : 1, |
| | | }) |
| | | ); |
| | | const insuranceTypes = schemeInsuranceDetailList |
| | | .map((item) => item.insuranceType) |
| | | .filter((v) => v) |
| | | .join(","); |
| | | // é¨é¨åç§°ï¼å¤ä¸ªä½¿ç¨éå·éå¼ï¼æ ¹æ®éä¸ç deptIds ä¸ deptList 计ç®ï¼ |
| | | const deptNames = (deptList.value || []) |
| | | .filter((d) => |
| | | (form.value.deptIds || []).some( |
| | | (id) => String(id) === String(d.deptId) |
| | | ) |
| | | ) |
| | | .map((d) => d.deptName) |
| | | .join(","); |
| | | const submitData = { |
| | | ...form.value, |
| | | insuranceBenefits: form.value.insuranceBenefits.map( |
| | | ({ _key, ...rest }) => rest |
| | | ), |
| | | id: form.value.id, |
| | | title: form.value.title, |
| | | remark: form.value.remark ?? "", |
| | | deptIds, |
| | | insuranceTypes, |
| | | deptNames, |
| | | schemeInsuranceDetailList, |
| | | }; |
| | | if (operationType.value === "add") { |
| | | socialSecurityAdd(submitData).then(() => { |
| | |
| | | flex-wrap: wrap; |
| | | gap: 16px; |
| | | } |
| | | .base-salary-wrap { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | gap: 8px; |
| | | } |
| | | .base-salary-text { |
| | | color: #606266; |
| | | font-size: 14px; |
| | | } |
| | | .personal-ratio-wrap { |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <div style="margin-bottom: 10px"> |
| | | <div style="margin-bottom: 10px; display: flex; gap: 10px"> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢æ¹æ¡</el-button> |
| | | <el-button |
| | | type="danger" |
| | | @click="handleBatchDelete" |
| | | :disabled="selectedRows.length === 0" |
| | | > |
| | | æ¹éå é¤ |
| | | </el-button> |
| | | </div> |
| | | <PIMTable |
| | | rowKey="id" |
| | |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="page.total" |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="pagination" |
| | | /> |
| | | </div> |
| | | <form-dia ref="formDiaRef" @close="handleQuery" /> |
| | |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import FormDia from "./components/formDia.vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { socialSecurityListPage } from "@/api/personnelManagement/socialSecuritySet.js"; |
| | | import { |
| | | socialSecurityListPage, |
| | | socialSecurityDelete, |
| | | } from "@/api/personnelManagement/socialSecuritySet.js"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | |
| | | |
| | | const tableColumn = ref([ |
| | | { label: "主é¢", prop: "title", minWidth: 120 }, |
| | | { label: "ä¿é©ç±»å", prop: "insuranceTypeName", width: 120 }, |
| | | { label: "使ç¨èå´", prop: "scopeName", width: 120 }, |
| | | { label: "ä¿é©ç±»å", prop: "insuranceTypes", width: 120 }, |
| | | { label: "使ç¨èå´", prop: "deptNames", width: 120 }, |
| | | { label: "夿³¨", prop: "remark", minWidth: 120 }, |
| | | { label: "å建æ¶é´", prop: "createTime", width: 160 }, |
| | | { label: "å建人", prop: "createBy", width: 100 }, |
| | | { label: "å建人", prop: "createUserName", width: 100 }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 120, |
| | | width: 180, |
| | | operation: [ |
| | | { |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => openForm("edit", row), |
| | | }, |
| | | { |
| | | name: "详æ
", |
| | | type: "text", |
| | | clickFun: (row) => openForm("detail", row), |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | style: { |
| | | color: "#F56C6C", |
| | | }, |
| | | clickFun: (row) => handleDelete(row), |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const selectedRows = ref([]); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | |
| | | }); |
| | | }; |
| | | |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | const openForm = (type, row) => { |
| | | nextTick(() => { |
| | | formDiaRef.value?.openDialog(type, row); |
| | | }); |
| | | }; |
| | | |
| | | // å 餿¹æ¡ï¼é»è¾ä¸å
¶å®é¡µé¢ä¿æä¸è´ï¼ç¡®è®¤å¼¹çª + è°ç¨å 餿¥å£ + å·æ°åè¡¨ï¼ |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm( |
| | | `确认å 餿¹æ¡"${row.title}"åï¼`, |
| | | "å é¤ç¡®è®¤", |
| | | { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | socialSecurityDelete([row.id]) |
| | | .then(() => { |
| | | ElMessage.success("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("å é¤å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.info("已忶å é¤"); |
| | | }); |
| | | }; |
| | | |
| | | // æ¹éå é¤ |
| | | const handleBatchDelete = () => { |
| | | if (!selectedRows.value.length) return; |
| | | ElMessageBox.confirm( |
| | | `ç¡®å®è¦å é¤éä¸ç ${selectedRows.value.length} æ¡æ¹æ¡åï¼`, |
| | | "æ¹éå é¤ç¡®è®¤", |
| | | { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | socialSecurityDelete(ids) |
| | | .then(() => { |
| | | ElMessage.success("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("å é¤å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.info("已忶å é¤"); |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |