|
@@ -4,7 +4,7 @@
|
|
|
@register="register"
|
|
|
:title="t('routes.devices.title')"
|
|
|
@ok="saveTable"
|
|
|
- width="600px"
|
|
|
+ width="700px"
|
|
|
@visible-change="handleVisibleChange"
|
|
|
>
|
|
|
<div class="pt-3px pr-3px">
|
|
@@ -35,7 +35,11 @@
|
|
|
style="width: 260px; text-align: center"
|
|
|
class="justify-center suNum"
|
|
|
:min="0"
|
|
|
- @blur="numOnChange.bind(null, field)"
|
|
|
+ @blur="
|
|
|
+ () => {
|
|
|
+ numOnChange(true, field);
|
|
|
+ }
|
|
|
+ "
|
|
|
:max="999"
|
|
|
>
|
|
|
<template #addonBefore>
|
|
@@ -83,7 +87,7 @@
|
|
|
// },
|
|
|
{
|
|
|
icon: 'mdi:account-multiple-remove-outline',
|
|
|
- label: t('common.unbind'),
|
|
|
+ label: '删除',
|
|
|
onClick: handleDelete.bind(null, record, 'unbond'),
|
|
|
},
|
|
|
]"
|
|
@@ -160,6 +164,17 @@
|
|
|
dataIndex: 'userName',
|
|
|
},
|
|
|
{
|
|
|
+ title: '角色',
|
|
|
+ width: 150,
|
|
|
+ dataIndex: 'roleName',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'roleId',
|
|
|
+ width: 150,
|
|
|
+ ifShow: false,
|
|
|
+ dataIndex: 'roleId',
|
|
|
+ },
|
|
|
+ {
|
|
|
title: t('common.operating'),
|
|
|
dataIndex: '',
|
|
|
slots: { customRender: 'action' },
|
|
@@ -305,9 +320,13 @@
|
|
|
addeduser: total?.length || 0,
|
|
|
});
|
|
|
}
|
|
|
- function numOnChange(data) {
|
|
|
- let { lookNum } = getFieldsValue();
|
|
|
- modelRef.subNum = lookNum + data;
|
|
|
+ async function numOnChange() {
|
|
|
+ // await setFieldsValue({
|
|
|
+ // [name]: data,
|
|
|
+ // });
|
|
|
+ let { shotNum, lookNum } = getFieldsValue();
|
|
|
+ modelRef.subNum = lookNum + shotNum;
|
|
|
+ validateFields(['lookNum', 'shotNum']);
|
|
|
}
|
|
|
async function numsOnChange(data, type) {
|
|
|
let formdata = getFieldsValue();
|
|
@@ -384,17 +403,47 @@
|
|
|
// });
|
|
|
callback(tableList);
|
|
|
}
|
|
|
+ // function formatRoleName(val) {
|
|
|
+
|
|
|
+ // },
|
|
|
function handleAddUser(newUser) {
|
|
|
+ let DataSource = getDataSource();
|
|
|
+ let { shotNum, lookNum } = getFieldsValue();
|
|
|
+ const total = DataSource?.length;
|
|
|
+ let look = 0,
|
|
|
+ shoot = 0;
|
|
|
+ DataSource.map((ele) => {
|
|
|
+ if (ele.roleId == 8) {
|
|
|
+ look++;
|
|
|
+ shoot++;
|
|
|
+ } else if (ele.roleId == 81) {
|
|
|
+ look++;
|
|
|
+ } else if (ele.roleId == 82) {
|
|
|
+ shoot++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log('look', look, shoot, 'shotNum, lookNum', shotNum, lookNum);
|
|
|
+ if (!(look < lookNum)) {
|
|
|
+ return createMessage.error('可带看员工数不足');
|
|
|
+ } else if (!(shoot < shotNum)) {
|
|
|
+ return createMessage.error('可拍摄员工数不足');
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ 8: '带看&拍摄员工',
|
|
|
+ 81: '带看员工',
|
|
|
+ 82: '拍摄员工',
|
|
|
+ };
|
|
|
insertTableDataRecord({
|
|
|
nickName: newUser.memoName,
|
|
|
userName: newUser.phone,
|
|
|
phone: newUser.phone,
|
|
|
+ roleName: obj[newUser.roleId],
|
|
|
+ roleId: newUser.roleId,
|
|
|
});
|
|
|
- const total = getDataSource()?.length;
|
|
|
setFieldsValue({
|
|
|
addeduser: total || 0,
|
|
|
});
|
|
|
- // modelRef.subNum = total
|
|
|
+ createMessage.success(t('layout.setting.operatingTitle'));
|
|
|
}
|
|
|
return {
|
|
|
register,
|