pc端维修修改

pc端维修修改
This commit is contained in:
shawn 2020-02-04 11:18:22 +08:00
parent 24cba2a5ee
commit 6705db5f96
6 changed files with 530 additions and 65 deletions

View file

@ -1,5 +1,18 @@
import request from '@/utils/request'
// 门店维修员工列表
export function getServiceEmp(serviceid) {
var params = new URLSearchParams()
if (serviceid !== '' && serviceid !== null && serviceid !== undefined) {
params.append('repositoryId', serviceid) // 你要传给后台的参数值 key/value
}
return request({
url: '/repository/getServiceEmp',
method: 'post',
data: params
})
}
// 维修列表
export function repairList(query) {
var params = new URLSearchParams()
@ -116,19 +129,62 @@ export function repositorylist(query) {
// 新增维修订单
export function newservice(query) {
var params = new URLSearchParams()
params.append('components', query.components) // 你要传给后台的参数值 key/value
params.append('detail', query.detail) // 你要传给后台的参数值 key/value
params.append('producttype', query.producttype) // 你要传给后台的参数值 key/value
params.append('userid', query.userid) // 你要传给后台的参数值 key/value
params.append('address', query.address) // 你要传给后台的参数值 key/value
params.append('personname', query.personname) // 你要传给后台的参数值 key/value
params.append('phonenumber', query.phonenumber) // 你要传给后台的参数值 key/value
params.append('servicexpecttime', query.servicexpecttime) // 你要传给后台的参数值 key/value
params.append('repositoryid', query.repositoryid) // 你要传给后台的参数值 key/value
params.append('cityid', query.cityid) // 你要传给后台的参数值 key/value
params.append('provinceid', query.provinceid) // 你要传给后台的参数值 key/value
params.append('components', query.components) // 你要传给后台的参数值 key/value
params.append('servicemode', query.servicemode) // 你要传给后台的参数值 key/value
// params.append('detail', query.detail) // 你要传给后台的参数值 key/value
// params.append('producttype', query.producttype) // 你要传给后台的参数值 key/value
// params.append('userid', query.userid) // 你要传给后台的参数值 key/value
// params.append('address', query.address) // 你要传给后台的参数值 key/value
// params.append('personname', query.personname) // 你要传给后台的参数值 key/value
// params.append('phonenumber', query.phonenumber) // 你要传给后台的参数值 key/value
// params.append('servicexpecttime', query.servicexpecttime) // 你要传给后台的参数值 key/value
// params.append('repositoryid', query.repositoryid) // 你要传给后台的参数值 key/value
// params.append('cityid', query.cityid) // 你要传给后台的参数值 key/value
// params.append('provinceid', query.provinceid) // 你要传给后台的参数值 key/value
// params.append('components', query.components) // 你要传给后台的参数值 key/value
// params.append('servicemode', query.servicemode) // 你要传给后台的参数值 key/value
if (query.employeeId !== '' && query.employeeId !== null && query.employeeId !== undefined) {
params.append('employeeId', query.employeeId) // 你要传给后台的参数值 key/value
}
if (query.detail !== '' && query.detail !== null && query.detail !== undefined) {
params.append('detail', query.detail) // 你要传给后台的参数值 key/value
}
if (query.producttype !== '' && query.producttype !== null && query.producttype !== undefined) {
params.append('producttype', query.producttype) // 你要传给后台的参数值 key/value
}
if (query.userid !== '' && query.userid !== null && query.userid !== undefined) {
params.append('userid', query.userid) // 你要传给后台的参数值 key/value
}
if (query.address !== '' && query.address !== null && query.address !== undefined) {
params.append('address', query.address) // 你要传给后台的参数值 key/value
}
if (query.personname !== '' && query.personname !== null && query.personname !== undefined) {
params.append('personname', query.personname) // 你要传给后台的参数值 key/value
}
if (query.phonenumber !== '' && query.phonenumber !== null && query.phonenumber !== undefined) {
params.append('phonenumber', query.phonenumber) // 你要传给后台的参数值 key/value
}
if (query.servicexpecttime !== '' && query.servicexpecttime !== null && query.servicexpecttime !== undefined) {
params.append('servicexpecttime', query.servicexpecttime) // 你要传给后台的参数值 key/value
}
if (query.repositoryid !== '' && query.repositoryid !== null && query.repositoryid !== undefined) {
params.append('repositoryid', query.repositoryid) // 你要传给后台的参数值 key/value
}
if (query.cityid !== '' && query.cityid !== null && query.cityid !== undefined) {
params.append('cityid', query.cityid) // 你要传给后台的参数值 key/value
}
if (query.provinceid !== '' && query.provinceid !== null && query.provinceid !== undefined) {
params.append('provinceid', query.provinceid) // 你要传给后台的参数值 key/value
}
if (query.components !== '' && query.components !== null && query.components !== undefined) {
params.append('components', query.components) // 你要传给后台的参数值 key/value
}
if (query.servicemode !== '' && query.servicemode !== null && query.servicemode !== undefined) {
params.append('servicemode', query.servicemode) // 你要传给后台的参数值 key/value
}
return request({
url: '/admin/service/newservice',
method: 'post',
@ -150,9 +206,10 @@ export function repairprojectList(query) {
}
// 维修项目修改
export function editrepairproject(price, itemid) {
export function editrepairproject(price, itemid, otherPrice) {
var params = new URLSearchParams()
params.append('price', price) // 你要传给后台的参数值 key/value
params.append('otherPrice', otherPrice) // 你要传给后台的参数值 key/value
params.append('itemid', itemid) // 你要传给后台的参数值 key/value
return request({
url: '/admin/service/updateserviceitem',
@ -178,6 +235,7 @@ export function addrepairproject(query) {
params.append('producttype', query.producttype) // 你要传给后台的参数值 key/value
params.append('name', query.name) // 你要传给后台的参数值 key/value
params.append('price', query.price) // 你要传给后台的参数值 key/value
params.append('otherPrice', query.otherPrice) // 你要传给后台的参数值 key/value
params.append('desc', query.desc) // 你要传给后台的参数值 key/value
params.append('mark', query.mark) // 你要传给后台的参数值 key/value
return request({

View file

@ -3804,6 +3804,11 @@ export default {
landline: 'landline'
},
otherlanguage: {
wxy: '维修员',
wxxm: '维修项目',
fbdkh: '非本店客户价格',
xjdh: '询价单号',
xzgs: '选择公司',
zc: '整车',
pj: '配件',
jgj: '紧固件',
@ -3830,7 +3835,11 @@ export default {
qmye: '期末余额',
jf: '借方',
df: '贷方',
zcfp: '重新分派'
zcfp: '重新分派',
qyong: '启用',
tingyong: '停用',
fs: '发送',
bfs: '不发送'
},
accessComponent: {
accessPersonId: 'receiver',

View file

@ -3837,6 +3837,9 @@ export default {
landline: '座机号'
},
otherlanguage: {
wxy: '维修员',
wxxm: '维修项目',
fbdkh: '非本店客户价格',
xjdh: '询价单号',
xzgs: '选择公司',
zc: '整车',

View file

@ -32,7 +32,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -90,7 +90,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -147,7 +147,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -204,7 +204,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -261,7 +261,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -318,7 +318,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -375,7 +375,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -432,7 +432,7 @@
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>cnpm install node-sass@latest
</el-table-column>
<el-table-column :label="$t('repair.customername')" :resizable="false" prop="personName" width="90px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.personName }}</span>
@ -709,10 +709,30 @@
<el-button type="primary" @click="dispatch">{{ $t('repair.ok') }}</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible" :title="$t('repair.Add')" width="60%" center lock-scroll top="20px">
<el-dialog :visible.sync="dialogFormVisible" class="normal" width="600px" center :title="$t('repair.Add')">
<el-form ref="form" :model="form" :rules="personalrules" style="width: 400px; margin-left:50px;margin-top: 37px;">
<el-form-item :label-width="formLabelWidth" :label="$t('repair.Servicebranch')" prop="repositoryid">
<el-select v-model="form.repositoryid" placeholder="please choose" filterable style="width: 300px" @change="chooserepository">
<el-option
v-for="item in shopoptions"
:key="item.id"
:label="item.repositoryName"
:value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('otherlanguage.wxy')" prop="employeeId">
<!-- <el-input v-model="form.employeename" @focus="chooserepairperson" clearable style="width: 300px"/>
<my-emp :control.sync="stockControl"/> -->
<el-select v-model="form.employeeId" placeholder="please choose" filterable style="width: 300px">
<el-option
v-for="item in employees"
:key="item.id"
:label="item.personName"
:value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('repair.Model')" prop="producttype">
<el-select v-model="form.producttype" placeholder="please choose">
<el-select v-model="form.producttype" placeholder="please choose" style="width: 300px">
<el-option
v-for="(item, index) in options"
:key="index"
@ -720,43 +740,29 @@
:value="item.categoryName"/>
</el-select>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('repair.Parts')" prop="components">
<el-input v-model="form.components" @focus="choosefault"/>
<my-fault :packagecontrol.sync="faultcontrol" @faultdetail="faultdetail"/>
<!-- <el-cascader-->
<!-- :options="regions"-->
<!-- :props="props"-->
<!-- v-model="form.components"-->
<!-- :placeholder="$t('Hmodule.xzqy')"-->
<!-- filterable-->
<!-- clearable-->
<!-- style="width: 100%;"-->
<!-- @change="handlechange4"-->
<!-- />-->
</el-form-item>
<!-- <el-form-item :label-width="formLabelWidth" prop="userid" :label="$t('repair.LoginAccount')">-->
<!-- <el-input v-model="userid" @focus="chooseCustomer"/>-->
<!-- <my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>-->
<!-- </el-form-item>-->
<el-form-item :label-width="formLabelWidth" :label="$t('repair.Name2')" prop="personname">
<el-input v-model="form.personname" @focus="chooseCustomer"/>
<el-input v-model="form.personname" @focus="chooseCustomer" style="width: 300px"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
</el-form-item>
<!-- <el-form-item :label-width="formLabelWidth" prop="personname" :label="$t('repair.Name2')">-->
<!-- <el-input v-model="form.personname"/>-->
<!-- </el-form-item>-->
<el-form-item :label-width="formLabelWidth" :label="$t('repair.MobileNumber')" prop="phonenumber">
<el-input v-model="form.phonenumber"/>
<el-input v-model="form.phonenumber" style="width: 300px"/>
</el-form-item>
<!-- //12-->
<el-form-item :label-width="formLabelWidth" :label="$t('repair.servicemode')" prop="servicemode">
<el-select v-model="form.servicemode" @change="choosemode">
<el-option value="1" label="上门维修" />
<el-select v-model="form.servicemode" @change="choosemode" style="width: 300px">
<!-- <el-option value="1" label="上门维修" /> -->
<el-option value="2" label="到店维修" />
</el-select>
</el-form-item>
<el-form-item v-show="isshow" :label-width="formLabelWidth" :label="$t('Customer.provinceid')" prop="provinceid">
<el-select v-model="form.provinceid" filterable placeholder="请选择省" @change="handlechange2">
<!-- <el-form-item v-show="isshow" :label-width="formLabelWidth" :label="$t('Customer.provinceid')" prop="provinceid">
<el-select v-model="form.provinceid" filterable placeholder="请选择省" @change="handlechange2" style="width: 300px">
<el-option
v-for="(item, index) in provinces"
:key="index"
@ -765,36 +771,27 @@
</el-select>
</el-form-item>
<el-form-item v-show="isshow" :label-width="formLabelWidth" :label="$t('Customer.cityid')" prop="cityid">
<el-select v-model="form.cityid" filterable placeholder="请选择市">
<el-select v-model="form.cityid" filterable placeholder="请选择市" style="width: 300px">
<el-option
v-for="(item, index) in cities"
:key="index"
:label="item.name"
:value="item.id"/>
</el-select>
</el-form-item>
<el-form-item v-show="isshow" :label-width="formLabelWidth" :label="$t('repair.Address2')" prop="address">
<el-input v-model="form.address"/>
</el-form-item>
</el-form-item> -->
<!-- <el-form-item v-show="isshow" :label-width="formLabelWidth" :label="$t('repair.Address2')" prop="address">
<el-input v-model="form.address" style="width: 300px"/>
</el-form-item> -->
<el-form-item :label-width="formLabelWidth" :label="$t('repair.ExpectedTime')" prop="servicexpecttime">
<el-date-picker
v-model="form.servicexpecttime"
type="date"
value-format="yyyy-MM-dd"
style="width: 198px;"
style="width: 300px"
:placeholder="$t('Hmodule.xzrq')"/>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('repair.Servicebranch')" prop="repositoryid">
<el-select v-model="form.repositoryid" placeholder="please choose">
<el-option
v-for="item in shopoptions"
:key="item.id"
:label="item.repositoryName"
:value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('repair.Description2')">
<el-input v-model="form.detail"/>
<el-input v-model="form.detail" style="width: 300px"/>
</el-form-item>
</el-form>
@ -834,11 +831,12 @@
</template>
<script>
import { repairList, repairDetail, repairtoemp, searchproblemobject, repositorylist, newservice, getserviceschedule, deleteservice, retoreposervice, serviceretoemp, endservicebackground, getremplist2 } from '@/api/repair'
import {getServiceEmp, repairList, repairDetail, repairtoemp, searchproblemobject, repositorylist, newservice, getserviceschedule, deleteservice, retoreposervice, serviceretoemp, endservicebackground, getremplist2 } from '@/api/repair'
import { getprovincelist, getcitylist } from '@/api/public'
import { getposition } from '@/api/map'
import MyCustomer from './MyCustomer'
import MyFault from './components/MyFault'
import MyEmp from './components/MyEmp'
import waves from '@/directive/waves' // Waves directive
import permission from '@/directive/permission/index.js' //
import permission2 from '@/directive/permission2/index.js' //
@ -857,7 +855,7 @@ var _that
export default {
name: 'InstallOrder',
directives: { waves, permission, permission2 },
components: { Pagination, MyCustomer, MyFault },
components: { Pagination, MyCustomer, MyFault, MyEmp },
filters: {
fenpai: function(val) {
if (val === null) {
@ -901,7 +899,18 @@ export default {
callback()
}
}
const validatePass3 = (rule, value, callback) => {
console.log(this.form.employeename)
if (this.form.employeename === undefined || this.form.employeename === null || this.form.employeename === '') {
callback(new Error('请选择维修员'))
} else {
callback()
}
}
return {
employees: [],
stockControl: false,
faultcontrol: false,
isshow: false,
personalrules: {
@ -934,6 +943,9 @@ export default {
],
servicemode: [
{ required: true, message: '请选择维修方式', trigger: 'change' }
],
employeeId: [
{ required: true, message: '请选择维修员', trigger: 'change' }
]
},
xiala,
@ -1114,7 +1126,8 @@ export default {
servicexpecttime: '',
repositoryid: '',
detail: '',
cityid: ''
cityid: '',
servicemode: '2'
},
options2: [],
customercontrol: false,
@ -1149,11 +1162,29 @@ export default {
this.getAllStores()
this.customerdata2(2)
this.getlist()
// this.getrepairpersonn()
},
beforeCreate() {
_that = this
},
methods: {
chooserepository(val) {
console.log('val', val)
this.getrepairpersonn(val)
},
getrepairpersonn(val) {
getServiceEmp(this.form.repositoryid).then(res => {
console.log('res', res)
if (res.data.ret === 200) {
this.employees = res.data.data.content.filter(item => {
return item.serviceTask < 5
})
}
})
},
chooserepairperson() {
this.stockControl = true
},
faultdetail(val) {
this.form.components = val.map(item => {
return item.name
@ -1894,4 +1925,22 @@ export default {
background:#f1f1f1 ;
left: 0;
}
.normal >>> .el-dialog__header {
padding: 20px 20px 10px;
background: #fff;
position: static;
top: auto;
z-index: auto;
width: auto;
border-bottom: none;
}
.normal >>> .el-dialog {
-webkit-transform: none;
transform: none;
left: 0;
position: relative;
margin: 0 auto;
height: auto;
}
</style>

View file

@ -34,6 +34,11 @@
<span>{{ scope.row.price }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('otherlanguage.fbdkh')" :resizable='false' prop="price" min-width="80px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.otherPrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('repair.Description2')" :resizable='false' prop="description" min-width="110px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.description }}</span>
@ -58,6 +63,9 @@
<el-form-item :label-width="formLabelWidth" :label="$t('repair.price2')">
<el-input v-model="categoriesform.price"/>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('otherlanguage.fbdkh')">
<el-input v-model="categoriesform.otherPrice"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">{{ $t('repair.cancel') }}</el-button>
@ -81,6 +89,9 @@
<el-form-item :label-width="formLabelWidth" :label="$t('repair.price2')">
<el-input v-model="form.price"/>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('otherlanguage.fbdkh')">
<el-input v-model="form.otherPrice"/>
</el-form-item>
<el-form-item :label-width="formLabelWidth" :label="$t('repair.KPIScore')">
<el-input v-model="form.mark"/>
</el-form-item>
@ -223,7 +234,7 @@ export default {
updateData() {
const tempData = Object.assign({}, this.categoriesform)
const itemid = tempData.id
editrepairproject(this.categoriesform.price, itemid).then(res => {
editrepairproject(this.categoriesform.price, itemid, this.categoriesform.otherPrice).then(res => {
if (res.data.ret === 200) {
this.getList()
this.dialogFormVisible = false

View file

@ -0,0 +1,335 @@
<template>
<el-dialog :visible.sync="employeeVisible" :control="control" :close-on-press-escape="false" :title="$t('Hmodule.xzyg')" top="10px" append-to-body @close="$emit('update:control', false)">
<div class="filter-container">
<el-input v-model="getemplist.employeename" :placeholder="$t('NewEmployeeInformation.employeename')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.jobnumber" :placeholder="$t('NewEmployeeInformation.jobnumber2')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-date-picker
v-model="getemplist.time"
:placeholder="$t('Hmodule.xzrq')"
type="date"
class="filter-item"
value-format="yyyy-MM-dd"/>
<el-popover
placement="bottom"
width="500"
trigger="click">
<el-cascader
:options="regions2"
:props="props2"
v-model="getemplistregions"
:show-all-levels="false"
:placeholder="$t('Hmodule.xzqy')"
change-on-select
filterable
clearable
style="width: 40%;float: left;margin-left: 20px"
@change="handlechange4"
/>
<el-select v-model="getemplist.repositoryid" :placeholder="$t('Hmodule.xzmd')" clearable filterable style="width: 40%;float: right;margin-right: 20px">
<el-option
v-for="(item, index) in repositories"
:key="index"
:label="item.repositoryName"
:value="item.id"/>
</el-select>
<el-select v-model="getemplist.postid" :value="getemplist.postid" :placeholder="$t('NewEmployeeInformation.postid2')" class="filter-item" clearable style="width: 40%;float: left;margin-top: 10px;margin-left: 20px">
<el-option
v-for="(item, index) in jobs"
:key="index"
:label="item.categoryName"
:value="item.id"/>
</el-select>
<el-select v-model="getemplist.deptid" :placeholder="$t('NewEmployeeInformation.deptid2')" class="filter-item" clearable style="width: 40%;float: right;margin-top: 10px;margin-right: 20px">
<el-option
v-for="(item, index) in depts"
:key="index"
:label="item.deptName"
:value="item.id"/>
</el-select>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
</el-popover>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px;" @click="handleAdd">{{ $t('public.add') }}</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
:key="tableKey"
border
fit
highlight-current-row
style="width: 100%"
@current-change="handleCurrentChange">
<el-table-column
:label="$t('NewEmployeeInformation.id')"
:resizable="false"
property="id"
align="center"
width="50"/>
<el-table-column
:label="$t('NewEmployeeInformation.jobNumber')"
:resizable="false"
property="jobNumber"
align="center"
width="100"/>
<el-table-column
:label="$t('NewEmployeeInformation.account')"
:resizable="false"
property="account"
width="150"
align="center"/>
<el-table-column :label="$t('NewEmployeeInformation.name')" :resizable="false" align="center" width="109">
<template slot-scope="scope">
<span>{{ scope.row.firstName }} {{ scope.row.middleName }} {{ scope.row.lastName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.gender')" :resizable="false" prop="gender" align="center" width="80">
<template slot-scope="scope">
<span>{{ scope.row.gender | genderFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.deptName')" :resizable="false" prop="deptName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.deptName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.regionName')" :resizable="false" prop="regionName" align="center" width="230">
<template slot-scope="scope">
<span>{{ scope.row.regionName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.repositoryName')" :resizable="false" prop="repositoryName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.repositoryName }}</span>
</template>
</el-table-column>
</el-table>
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-top: 10px" @click="handleConfirm">{{ $t('Hmodule.sure') }}</el-button>
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" @pagination="gitemplist" />
</el-dialog>
</template>
<script>
import { regionlist, searchRepository } from '@/api/public'
import { getemplist, getdeptlist, searchEmpCategory } from '@/api/EmployeeInformation'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
// eslint-disable-next-line no-unused-vars
var _that
export default {
directives: { waves },
components: { Pagination },
filters: {
genderFilter(status) {
const statusMap = {
1: '男',
2: '女'
}
return statusMap[status]
}
},
props: {
control: {
type: Boolean,
default: false
}
},
data() {
return {
//
jobCat: {
type: 2,
pagenum: 1,
pagesize: 9999
},
//
jobs: [],
//
choosedata: '',
//
managerPeople: '',
//
regionManagerId: '',
// /
//
currentRow: null,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
repositoryid: '',
regionid: '',
postid: '',
deptid: '',
employeename: '',
pagenum: 1,
pagesize: 10,
stat: 1, loginRepositoryId: this.$store.getters.repositoryId, regionIds: this.$store.getters.regionIds,
time: '',
jobnumber: ''
},
//
depts: [],
//
props2: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
//
regions2: [],
getemplistregions: [],
//
repositories: [],
//
employeeVisible: this.control,
//
regionManagerVisible: false
}
},
watch: {
control() {
this.employeeVisible = this.control
this.gitemplist()
}
},
beforeCreate() {
_that = this
},
methods: {
//
gitemplist() {
//
this.listLoading = true
console.log(this.getemplist)
getemplist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
//
getdeptlist().then(res => {
if (res.data.ret === 200) {
this.depts = res.data.data.content
}
})
//
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions2 = this.tranKTree(res.data.data.content)
}
})
//
searchEmpCategory(this.jobCat).then(res => {
if (res.data.ret === 200) {
this.jobs = res.data.data.content.list
} else {
console.log('职位列表出错')
}
})
},
//
tranKTree(arr) {
if (!arr || !arr.length) return
return arr.map(item => ({
id: item.id,
regionName: item.regionName,
regionListVos: this.tranKTree(item.regionListVos)
}))
},
//
handleFilter() {
this.getemplist.regionid = this.getemplistregions[this.getemplistregions.length - 1]
getemplist(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list
this.total = res.data.data.content.totalCount
} else {
this.$notify.error({
title: '错误',
message: '出错了',
offset: 100
})
}
})
},
//
handleAdd() {
this.employeeVisible = false
this.$router.push('/EmployeeInformation/NewEmployeeInformation')
},
//
handlechange4(val) {
console.log(val)
const finalid = val[val.length - 1]
searchRepository(finalid).then(res => {
if (res.data.ret === 200) {
console.log(res)
this.repositories = res.data.data.content.list
} else {
this.$message.error('出错了')
}
})
},
//
restemplist() {
this.getemplist = {
repositoryid: '',
regionid: '',
postid: '',
deptid: '',
employeename: '',
pagenum: 1,
pagesize: 10,
stat: 1, loginRepositoryId: this.$store.getters.repositoryId, regionIds: this.$store.getters.regionIds,
time: '',
jobnumber: ''
}
this.getemplistregions = []
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('stockName', this.choosedata)
}
//
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 140px;
margin-left: 20px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>