工种管理 列表的接口联调+删除工种的接口联调+添加工种,编辑工种 2个接口联调
| | |
| | | data |
| | | }) |
| | | } |
| | | // 添加跟进记录 |
| | | export function getAddFollowRecord(data) { |
| | | return request({ |
| | | url: "/api/followRecord/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 删除员工信息 |
| | | export function getDeleteWorkerInfo(data) { |
| | | return request({ |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 更新跟进记录 |
| | | export function getUpdateFollowRecord(data) { |
| | | // 添加员工 |
| | | export function createWorkerInfo(data) { |
| | | return request({ |
| | | url: "/api/followRecord/update", |
| | | method: "put", |
| | | url: "/api-jl/v1/worker/createWorkerInfo", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 联系方式列表 |
| | | export function getContactInfoList() { |
| | | // 更新员工 |
| | | export function updateWorkerInfo(data) { |
| | | return request({ |
| | | url: "/api/contactInformation/list", |
| | | method: "get" |
| | | url: "/api-jl/v1/worker/updateWorkerInfo", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 工种列表 |
| | | export function getWorkTypeList(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/worker/getWorkTypeList", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 删除工种 |
| | | export function deleteWorkTypeInfo(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/worker/deleteWorkTypeInfo/"+data.id, |
| | | method: "delete", |
| | | data |
| | | }) |
| | | } |
| | | // 添加工种 |
| | | export function saveWorkTypeInfo(data) { |
| | | return request({ |
| | | url: "/api-jl/v1/worker/saveWorkTypeInfo", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | |
| | | "$1", |
| | | ); |
| | | // 暂无登录,写死token |
| | | token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOiI3NjFlM2NmNi05ZjRmLTQyMGQtYjc0ZC01NzNlZDc2NzA5MjAiLCJVc2VybmFtZSI6ImFkbWluIiwiTmlja05hbWUiOiIiLCJQYXJlbnRJZCI6ImFkbWluIiwiVXNlclR5cGUiOjIsIlJvbGVJZHMiOlsxXSwiT3JnSUQiOjEsIk1vZGlmaWVkUHdkIjp0cnVlLCJCdWZmZXJUaW1lIjo4NjQwMCwiZXhwIjoxNzEyNzI4MzI5LCJpc3MiOiJxbVBsdXMiLCJuYmYiOjE3MTIxMjI1Mjl9.KBJRT2PkRPG4UJD2hsO-fU_bylHMJ78xrWidq8xYMnw' |
| | | // token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOiI3NjFlM2NmNi05ZjRmLTQyMGQtYjc0ZC01NzNlZDc2NzA5MjAiLCJVc2VybmFtZSI6ImFkbWluIiwiTmlja05hbWUiOiIiLCJQYXJlbnRJZCI6ImFkbWluIiwiVXNlclR5cGUiOjIsIlJvbGVJZHMiOlsxXSwiT3JnSUQiOjEsIk1vZGlmaWVkUHdkIjp0cnVlLCJCdWZmZXJUaW1lIjo4NjQwMCwiZXhwIjoxNzEyNzI4MzI5LCJpc3MiOiJxbVBsdXMiLCJuYmYiOjE3MTIxMjI1Mjl9.KBJRT2PkRPG4UJD2hsO-fU_bylHMJ78xrWidq8xYMnw' |
| | | if (token) { |
| | | config.headers.Authorization = "Bearer " + token; |
| | | } |
| | |
| | | <el-form-item label="手机号:" prop="phoneNum"> |
| | | <el-input v-model="form.phoneNum" placeholder="请输入" maxlength="11" show-word-limit></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="入职时间:" prop="date"> |
| | | <el-date-picker v-model="form.date" style="width:100%;" type="date" placeholder="选择日期" |
| | | <el-form-item label="入职时间:" prop="employmentTime"> |
| | | <el-date-picker v-model="form.employmentTime" style="width:100%;" type="date" placeholder="选择日期" |
| | | value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="车间:" prop="phoneNum"> |
| | | <el-select v-model="form.phoneNum" filterable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in DeviceList" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-form-item label="车间:" prop="shopNameObj"> |
| | | <el-select v-model="form.shopNameObj" filterable placeholder="请选择" style="width: 100%" @change='getGroupNumber'> |
| | | <el-option v-for="item in shopList" :key="item.number" |
| | | :label="item.name" |
| | | :value="{ value: item.number, label: item.name }"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="组别:" prop="phoneNum"> |
| | | <el-select v-model="form.phoneNum" filterable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in DeviceList" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-form-item label="组别:" prop="groupNumber"> |
| | | <el-select v-model="form.groupNumber" filterable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in groupNumberList" :key="item" :label="item" :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工种:" prop="phoneNum"> |
| | | <el-select v-model="form.phoneNum" filterable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in DeviceList" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-form-item label="工种:" prop="workTypeObj"> |
| | | <el-select v-model="form.workTypeObj" filterable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" |
| | | :value="{ value: item.id, label: item.name }"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js" |
| | | |
| | | import { createWorkerInfo,updateWorkerInfo,getWorkTypeList } from "@/api/employeeManage/employeeInfo.js" |
| | | import { |
| | | getDictList, |
| | | } from "@/api/productManage/silkRegisterForm.js"; |
| | | import { |
| | | getWorkshopManageGroup, |
| | | } from "@/api/productManage/productRegisterForm.js"; |
| | | export default { |
| | | props: { |
| | | editRow: { |
| | |
| | | id: '', |
| | | name: '', |
| | | phoneNum: '', |
| | | employmentTime:'', |
| | | shopNameObj:{}, |
| | | groupNumber:'', |
| | | workTypeObj:{}, |
| | | }, |
| | | shopList:[],//车间 |
| | | groupNumberList:[],//组别 |
| | | workTypeList:[], //工种 |
| | | rules: { |
| | | id: [ |
| | | { |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | DeviceList: [], |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getSelectDataList() |
| | | }, |
| | | watch: { |
| | | islook(newVal) { |
| | |
| | | formInfo() { |
| | | if (this.islook) { |
| | | this.form = { |
| | | explain: "", |
| | | prefixId: "", |
| | | id: "", |
| | | number: 0, |
| | | remark: "", |
| | | status: "", |
| | | frockLife: "", |
| | | frockName: "", |
| | | vendor: "", |
| | | id: '', |
| | | name: '', |
| | | phoneNum: '', |
| | | employmentTime:'', |
| | | shopNameObj:{}, |
| | | groupNumber:'', |
| | | workTypeObj:{}, |
| | | }; |
| | | this.$nextTick(()=>{ |
| | | this.$refs["form"].resetFields(); |
| | | if (this.editRow.id) { |
| | | this.form = JSON.parse(JSON.stringify(this.editRow)); |
| | | this.getGroupNumber(true) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | cancelMethod() { |
| | | getGroupNumber(val){ |
| | | // shopName |
| | | if(this.form.shopNameObj.value){ |
| | | //组别 |
| | | getWorkshopManageGroup({number:this.form.shopNameObj.value}).then((res) => { |
| | | if (res.code == 200) { |
| | | let groupNumberList = res.data || {}; |
| | | this.groupNumberList=[] |
| | | if(Object.keys(groupNumberList).length>0){ |
| | | for(let i in groupNumberList){ |
| | | this.groupNumberList.push(groupNumberList[i]) |
| | | } |
| | | this.form.shopName='' |
| | | // 编辑 |
| | | if(val){ |
| | | setTimeout(()=>{ |
| | | this.$set(this.form,'shopName',this.form.shopName) |
| | | },200) |
| | | } |
| | | } |
| | | }else{ |
| | | this.groupNumberList=[] |
| | | this.form.shopName='' |
| | | } |
| | | }); |
| | | }else{ |
| | | this.workshopGroupList =[] |
| | | } |
| | | }, |
| | | getSelectDataList() { |
| | | //车间 |
| | | getDictList({ |
| | | dictType: 1, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.shopList = res.data || []; |
| | | } |
| | | }); |
| | | getWorkTypeList({ |
| | | page:0, |
| | | pageSize:0, |
| | | keyWord:'' |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.workTypeList = res.data || []; |
| | | } |
| | | }); |
| | | }, |
| | | cancelMethod(val) { |
| | | this.$refs["form"].resetFields(); |
| | | this.islook = false; |
| | | if(val){ |
| | | this.$emit('refresh') |
| | | } |
| | | |
| | | }, |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | let form = JSON.parse(JSON.stringify(this.form)); |
| | | form.shopId=form.shopNameObj.value |
| | | form.shopName=form.shopNameObj.label |
| | | form.workTypeId=form.workTypeObj.value |
| | | form.workType=form.workTypeObj.label |
| | | if (this.editRow.type == "add") { |
| | | getDeleteFollowRecord(form).then((res) => { |
| | | createWorkerInfo(form).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "添加成功!", |
| | | type: "success", |
| | | }); |
| | | this.cancelMethod(); |
| | | this.cancelMethod(true); |
| | | } |
| | | }); |
| | | } else { |
| | | getDeleteFollowRecord(form).then((res) => { |
| | | updateWorkerInfo(form).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "编辑成功!", |
| | | type: "success", |
| | | }); |
| | | this.cancelMethod(); |
| | | this.cancelMethod(true); |
| | | } |
| | | }); |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <AddEmployee ref="addEmployee" :editRow="editRow" @shutdown="shutdown" /> |
| | | <AddEmployee ref="addEmployee" :editRow="editRow" @refresh="shutdown" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | if (res.data) { |
| | | const list = res.data |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.count |
| | | this.pagerOptions.totalCount = res.total |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | |
| | | this.getData() |
| | | }, |
| | | shutdown() { |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData(); |
| | | }, |
| | | // 新建 |
| | |
| | | // 编辑 |
| | | handleClick(row) { |
| | | let config=JSON.parse(JSON.stringify(row)); |
| | | this.editRow = { ...config, title:'编辑',type:'add' } |
| | | this.editRow = { ...config, |
| | | title:'编辑', |
| | | type:'edit', |
| | | shopNameObj:{ |
| | | value:config.shopId, |
| | | label:config.shopName, |
| | | }, |
| | | workTypeObj:{ |
| | | value:config.workTypeId, |
| | | label:config.workType, |
| | | } |
| | | } |
| | | this.$refs.addEmployee.islook = true; |
| | | }, |
| | | // 删除 |
| | |
| | | <div slot="title" class="tac drawerHeader">{{ editRow.title }}</div> |
| | | <div class="dialog-content-box"> |
| | | <el-form class="form-box" ref="form" :rules="rules" :model="form" label-width="120px" label-position="right"> |
| | | <el-form-item label="工种名称:" prop="id"> |
| | | <el-input v-model="form.id" placeholder="请输入"></el-input> |
| | | <el-form-item label="工种名称:" prop="workName"> |
| | | <el-input v-model="form.workName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="不达标保底:" prop="isCore"> |
| | | <el-form-item label="不达标保底:" prop="isGuaranteed"> |
| | | <el-switch |
| | | v-model="form.isCore" |
| | | v-model="form.isGuaranteed" |
| | | active-color="#409EFF" |
| | | inactive-color="#C0CCDA" |
| | | > |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="保底工资:" prop="produceAheadDay"> |
| | | <el-form-item label="保底工资:" prop="guaranteedWages"> |
| | | <el-input |
| | | v-model.number="form.produceAheadDay" |
| | | v-model.number="form.guaranteedWages" |
| | | maxlength="20" |
| | | style="width: calc(100% - 40px)" |
| | | clearable |
| | |
| | | ></el-input> |
| | | <span class="float_right">元/天</span> |
| | | </el-form-item> |
| | | <el-form-item label="薪资方案:" prop="name"> |
| | | 挡车工生产工资方案+满勤方案+工龄补贴方案 |
| | | <el-form-item label="薪资方案:" prop="salaryPlansName"> |
| | | {{ form.salaryPlansName }} |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js" |
| | | import { saveWorkTypeInfo } from "@/api/employeeManage/employeeInfo.js" |
| | | export default { |
| | | props: { |
| | | editRow: { |
| | |
| | | return { |
| | | islook: false, |
| | | form: { |
| | | id: '', |
| | | isCore: '', |
| | | phoneNum: '', |
| | | workName: '', |
| | | isGuaranteed: true, |
| | | guaranteedWages: null, |
| | | salaryPlansName:'', |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | workName: [ |
| | | { |
| | | required: true, |
| | | message: "请输入人员姓名", |
| | | message: "请输入", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | name: [ |
| | | { |
| | | required: true, |
| | | message: "请输入员工编码", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | produceAheadDay: [ |
| | | guaranteedWages: [ |
| | | { |
| | | required: false, |
| | | message: "请输入", |
| | |
| | | formInfo() { |
| | | if (this.islook) { |
| | | this.form = { |
| | | isCore: "", |
| | | id: "", |
| | | workName: '', |
| | | isGuaranteed: true, |
| | | guaranteedWages: null, |
| | | salaryPlansName:'', |
| | | }; |
| | | this.$nextTick(()=>{ |
| | | this.$refs["form"].resetFields(); |
| | | if (this.editRow.id) { |
| | | if (this.editRow.type=='edit') { |
| | | this.form = JSON.parse(JSON.stringify(this.editRow)); |
| | | } |
| | | }) |
| | |
| | | callback(); |
| | | } |
| | | }, |
| | | cancelMethod() { |
| | | cancelMethod(val) { |
| | | this.$refs["form"].resetFields(); |
| | | this.islook = false; |
| | | if(val){ |
| | | this.$emit('refresh') |
| | | } |
| | | }, |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | let form = JSON.parse(JSON.stringify(this.form)); |
| | | if (this.editRow.type == "add") { |
| | | getDeleteFollowRecord(form).then((res) => { |
| | | saveWorkTypeInfo(form).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "添加成功!", |
| | | message: this.editRow.type == "add"?"添加成功!":"编辑成功!", |
| | | type: "success", |
| | | }); |
| | | this.cancelMethod(); |
| | | this.cancelMethod(true); |
| | | } |
| | | }); |
| | | } else { |
| | | getDeleteFollowRecord(form).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "编辑成功!", |
| | | type: "success", |
| | | }); |
| | | this.cancelMethod(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | |
| | | <el-table-column label="操作" width="90" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button> |
| | | <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> |
| | | <el-button @click="delClick(scope.row)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <AddWorkKind ref="addWorkKind" :editRow="editRow" @shutdown="shutdown" /> |
| | | <AddWorkKind ref="addWorkKind" :editRow="editRow" @refresh="shutdown" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFollowRecordList, getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js" |
| | | import { getWorkTypeList, deleteWorkTypeInfo } from "@/api/employeeManage/employeeInfo.js" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddWorkKind from "@/views/employeeManage/workKindManage/components/AddWorkKind" |
| | | export default { |
| | |
| | | editRow: { |
| | | title: "新建", |
| | | }, |
| | | search_map: {}, |
| | | keyWord: '', |
| | | tableColumn: [ |
| | | { label: "工种名称", prop: "topic", min: 120, default: true }, // 主题 |
| | | { label: "保底工资(元/天)", prop: "client_name", min: 180, }, // 客户名称 |
| | | { label: "薪资方案", prop: "contact_name", min: 130, }, // 联系人姓名 |
| | | { label: "添加时间", prop: "client_status", width: 130 }, // 客户状态 |
| | | { label: "添加人", prop: "contact_information_name", min: 100 }, // 联系方式 |
| | | { label: "工种名称", prop: "workName", min: 120, default: true }, // 主题 |
| | | { label: "保底工资(元/天)", prop: "guaranteedWages", min: 180, }, // 客户名称 |
| | | { label: "薪资方案", prop: "salaryPlansName", min: 130, }, // 联系人姓名 |
| | | { label: "添加时间", prop: "createTime", width: 130 }, // 客户状态 |
| | | { label: "添加人", prop: "addPeople", min: 100 }, // 联系方式 |
| | | ], |
| | | showCol: [ |
| | | "工种名称", |
| | |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData(this.search_map) |
| | | this.getData(this.keyWord) |
| | | }, |
| | | computed: { |
| | | }, |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | | await getFollowRecordList({ |
| | | search_map: this.search_map, |
| | | await getWorkTypeList({ |
| | | keyWord: this.keyWord, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | if (res.data && res.data.length > 0) { |
| | | const list = res.data.map((item) => { |
| | | let salaryPlansName='' |
| | | if(item.salaryPlans){ |
| | | for(let i in item.$confirmsalaryPlans){ |
| | | salaryPlansName=salaryPlansName+'+'+item.salaryPlans[i].name |
| | | } |
| | | } |
| | | return { |
| | | ...item, |
| | | client_name: item.client.name, |
| | | contact_name: item.contact.name, |
| | | client_status: item.client_status.name, |
| | | phone: item.contact.phone, |
| | | member_name: item.member.username, |
| | | contact_information_name: item.contact_information.name |
| | | salaryPlansName:salaryPlansName, |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.count |
| | | this.pagerOptions.totalCount = res.total |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | this.search_map.client_name = searchText ?? "" |
| | | this.keyWord = searchText ?? "" |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | shutdown() { |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData(); |
| | | }, |
| | | // 新建 |
| | |
| | | // 编辑 |
| | | handleClick(row) { |
| | | let config=JSON.parse(JSON.stringify(row)); |
| | | this.editRow = { ...config, title:'编辑',type:'add' } |
| | | this.editRow = { ...config, title:'编辑',type:'edit',id:row.ID, } |
| | | this.$refs.addWorkKind.islook = true; |
| | | }, |
| | | // 删除 |
| | | delClick(id) { |
| | | delClick(row) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | getDeleteFollowRecord({ ids: [id] }).then((response) => { |
| | | deleteWorkTypeInfo({ id: row.ID }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getData() |