微信小程序

This commit is contained in:
磷叶 2024-12-06 13:58:14 +08:00
parent 5f5eac6d84
commit 8e2e810e69
2 changed files with 28 additions and 51 deletions

View File

@ -234,10 +234,10 @@
</form-col> </form-col>
</el-row> </el-row>
<el-row> <el-row>
<form-col :span="12" v-if="form.userId == undefined" label="用户账号" prop="userName"> <form-col :span="12" label="登录账号" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" /> <el-input v-model="form.userName" placeholder="请输入登录账号" maxlength="30" />
</form-col> </form-col>
<form-col :span="12" v-if="form.userId == undefined" label="用户密码" prop="password"> <form-col :span="12" label="登录密码" prop="password" v-if="form.userId == null">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/> <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
</form-col> </form-col>
<form-col :span="12" label="账号状态" prop="status"> <form-col :span="12" label="账号状态" prop="status">
@ -258,12 +258,12 @@
>{{dict.label}}</el-radio> >{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</form-col> </form-col>
<form-col :span="12" label="手机号码" prop="phonenumber"> <!-- <form-col :span="12" label="手机号码" prop="phonenumber">-->
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" /> <!-- <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />-->
</form-col> <!-- </form-col>-->
<form-col :span="12" label="邮箱" prop="email"> <!-- <form-col :span="12" label="邮箱" prop="email">-->
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" /> <!-- <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />-->
</form-col> <!-- </form-col>-->
<form-col :span="12" label="出生日期" prop="birthday"> <form-col :span="12" label="出生日期" prop="birthday">
<el-date-picker style="width: 100%" clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"/> <el-date-picker style="width: 100%" clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"/>
</form-col> </form-col>
@ -291,34 +291,13 @@
</el-dialog> </el-dialog>
<!-- 用户导入对话框 --> <!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <import-dialog
<el-upload :visible.sync="upload.open"
ref="upload" template-url="/system/user/importTemplate"
:limit="1" url="/system/user/importData"
accept=".xlsx, .xls" @success="getList"
:headers="upload.headers" template-name="用户导入模板"
:action="upload.url + '?updateSupport=' + upload.updateSupport" />
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -331,12 +310,13 @@ import FormCol from "@/components/FormCol/index.vue";
import {$showColumns} from "@/utils/mixins"; import {$showColumns} from "@/utils/mixins";
import {calcBirthDay, calcFullYear} from "@/utils/date"; import {calcBirthDay, calcFullYear} from "@/utils/date";
import {parseTime} from "@/utils/ruoyi"; import {parseTime} from "@/utils/ruoyi";
import ImportDialog from "@/components/ImportDialog/index.vue";
export default { export default {
name: "User", name: "User",
mixins: [$showColumns], mixins: [$showColumns],
dicts: ['sys_normal_disable', 'sys_user_sex', 'user_employ_status'], dicts: ['sys_normal_disable', 'sys_user_sex', 'user_employ_status'],
components: {FormCol, Treeselect }, components: {ImportDialog, FormCol, Treeselect },
data() { data() {
return { return {
// //
@ -418,10 +398,17 @@ export default {
], ],
// //
rules: { rules: {
userNo: [
{ required: true, message: "工号不能为空", trigger: "blur" }
],
userName: [ userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }, { required: true, message: "用户名称不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } { min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
], ],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
],
deptId: [ deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" } { required: true, message: "归属部门不能为空", trigger: "blur" }
], ],
@ -434,19 +421,8 @@ export default {
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" } { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
], ],
email: [ email: [
{ {type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"]}
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
], ],
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
} }
}; };
}, },
@ -511,7 +487,7 @@ export default {
// //
reset() { reset() {
this.form = { this.form = {
userId: undefined, userId: null,
deptId: undefined, deptId: undefined,
userName: undefined, userName: undefined,
nickName: undefined, nickName: undefined,

View File

@ -324,6 +324,7 @@
template-url="/yh/price/importTemplate" template-url="/yh/price/importTemplate"
url="/yh/price/importData" url="/yh/price/importData"
@success="getList" @success="getList"
template-name="单价导入模板"
/> />
</div> </div>
</template> </template>