|
|
@ -10,7 +10,7 @@ |
|
|
<qn-easyinput |
|
|
<qn-easyinput |
|
|
:maxlength="20" |
|
|
:maxlength="20" |
|
|
@blur="showCompany" |
|
|
@blur="showCompany" |
|
|
v-model="form.receiver" |
|
|
|
|
|
|
|
|
v-model="form.name" |
|
|
:inputBorder="false" |
|
|
:inputBorder="false" |
|
|
text="left" |
|
|
text="left" |
|
|
placeholder="请填写员工姓名" |
|
|
placeholder="请填写员工姓名" |
|
|
@ -23,7 +23,7 @@ |
|
|
<qn-easyinput |
|
|
<qn-easyinput |
|
|
:maxlength="11" |
|
|
:maxlength="11" |
|
|
type="number" |
|
|
type="number" |
|
|
v-model="form.receiverMobile" |
|
|
|
|
|
|
|
|
v-model="form.mobile" |
|
|
:inputBorder="false" |
|
|
:inputBorder="false" |
|
|
text="left" |
|
|
text="left" |
|
|
placeholder="请填写手机号码" |
|
|
placeholder="请填写手机号码" |
|
|
@ -37,7 +37,7 @@ |
|
|
<uni-data-checkbox mode="tag" multiple v-model="flag" :localdata="[{text: '全部',value: 1}]" @change="onChange()"></uni-data-checkbox> |
|
|
<uni-data-checkbox mode="tag" multiple v-model="flag" :localdata="[{text: '全部',value: 1}]" @change="onChange()"></uni-data-checkbox> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<uni-data-checkbox mode="button" multiple v-model="checkIds" :localdata="hobby" @change="onChange2()"></uni-data-checkbox> |
|
|
|
|
|
|
|
|
<uni-data-checkbox mode="button" multiple v-model="machineIds" :localdata="hobby" @change="onChange2()"></uni-data-checkbox> |
|
|
</view> |
|
|
</view> |
|
|
<view class="default-address"> |
|
|
<view class="default-address"> |
|
|
<view class="title">状态:</view> |
|
|
<view class="title">状态:</view> |
|
|
@ -49,6 +49,7 @@ |
|
|
<view class="button-area" style="margin-top: 36rpx;"> |
|
|
<view class="button-area" style="margin-top: 36rpx;"> |
|
|
<view class="button button__submit" @click="addTap"><text class="text" style="color: white">保存</text></view> |
|
|
<view class="button button__submit" @click="addTap"><text class="text" style="color: white">保存</text></view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view style="height: 48rpx;"></view> |
|
|
<uni-popup ref="popup" type="center" :mask-click="false"> |
|
|
<uni-popup ref="popup" type="center" :mask-click="false"> |
|
|
<view class="popup-box"> |
|
|
<view class="popup-box"> |
|
|
<view class="tip-title">确定要删除该员工吗?</view> |
|
|
<view class="tip-title">确定要删除该员工吗?</view> |
|
|
@ -65,18 +66,19 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { getMachinList } from '@/apis/factoryApi' |
|
|
import { getMachinList } from '@/apis/factoryApi' |
|
|
import { back } from '@/utils/hook.js' |
|
|
import { back } from '@/utils/hook.js' |
|
|
import { createAddress, getAddressDetail } from '@/apis/addressManageApi.js' |
|
|
|
|
|
|
|
|
import { deleteMember, getMemberInfo, updateMember } from '@/apis/enterpriseInfoApi.js' |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
form: { |
|
|
form: { |
|
|
|
|
|
|
|
|
|
|
|
name: '', |
|
|
|
|
|
mobile: '' |
|
|
}, |
|
|
}, |
|
|
id: null, |
|
|
id: null, |
|
|
hobby: [], |
|
|
hobby: [], |
|
|
checkIds: [], |
|
|
|
|
|
|
|
|
machineIds: [], |
|
|
flag: [], |
|
|
flag: [], |
|
|
radio: [] |
|
|
|
|
|
|
|
|
radio: 0 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
@ -94,17 +96,24 @@ export default { |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
if (option.id) { |
|
|
if (option.id) { |
|
|
this.id = option.id |
|
|
this.id = option.id |
|
|
this.getAddressDetail() |
|
|
|
|
|
|
|
|
this.getDetail() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
back, |
|
|
back, |
|
|
// 通过id查询收货地址 |
|
|
// 通过id查询收货地址 |
|
|
getAddressDetail() { |
|
|
|
|
|
getAddressDetail({ id: this.id }).then((res) => { |
|
|
|
|
|
// console.log('收货地址详情', res) |
|
|
|
|
|
|
|
|
getDetail() { |
|
|
|
|
|
getMemberInfo({ orgMemberId: this.id }).then((res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.form = Object.assign({}, res) |
|
|
this.form = Object.assign({}, res) |
|
|
|
|
|
if (res.machineList && res.machineList.length) { |
|
|
|
|
|
var checks = [] |
|
|
|
|
|
for (let i = 0; i < res.machineList.length; i++) { |
|
|
|
|
|
checks.push(res.machineList[i].id) |
|
|
|
|
|
} |
|
|
|
|
|
this.machineIds = checks |
|
|
|
|
|
} |
|
|
|
|
|
this.radio = res.status ? 1 : 0 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
@ -114,13 +123,14 @@ export default { |
|
|
for (let i = 0; i < this.hobby.length; i++) { |
|
|
for (let i = 0; i < this.hobby.length; i++) { |
|
|
checks.push(this.hobby[i].value) |
|
|
checks.push(this.hobby[i].value) |
|
|
} |
|
|
} |
|
|
this.checkIds = checks |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.machineIds = checks |
|
|
} else { |
|
|
} else { |
|
|
this.checkIds = [] |
|
|
|
|
|
|
|
|
this.machineIds = [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onChange2(){ |
|
|
onChange2(){ |
|
|
if(this.checkIds.length == this.hobby.length){ |
|
|
|
|
|
|
|
|
if(this.machineIds.length == this.hobby.length){ |
|
|
this.flag = [1] |
|
|
this.flag = [1] |
|
|
} else { |
|
|
} else { |
|
|
this.flag = [] |
|
|
this.flag = [] |
|
|
@ -128,7 +138,19 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 保存 |
|
|
// 保存 |
|
|
addTap() { |
|
|
addTap() { |
|
|
console.log(this.checkIds) |
|
|
|
|
|
|
|
|
var params = {id : this.form.id} |
|
|
|
|
|
params.realName = this.form.name |
|
|
|
|
|
params.machineIds = this.machineIds |
|
|
|
|
|
params.status = this.radio ? true : false |
|
|
|
|
|
updateMember(params).then((res) => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
uni.$emit('employee',{msg:'页面更新'}) |
|
|
|
|
|
uni.showToast({ title: '保存成功', icon: 'success' }) |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
back() |
|
|
|
|
|
}, 500) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
delTap(){ |
|
|
delTap(){ |
|
|
this.$refs.popup.open('center') |
|
|
this.$refs.popup.open('center') |
|
|
@ -137,7 +159,15 @@ export default { |
|
|
this.$refs.popup.close() |
|
|
this.$refs.popup.close() |
|
|
}, |
|
|
}, |
|
|
confirmTap(){ |
|
|
confirmTap(){ |
|
|
uni.$emit('employee',{msg:'页面更新'}) |
|
|
|
|
|
|
|
|
deleteMember({idList: [this.form.id]}).then((res) => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
uni.$emit('employee',{msg:'页面更新'}) |
|
|
|
|
|
uni.showToast({ title: '删除成功', icon: 'success' }) |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
back() |
|
|
|
|
|
}, 500) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|