|
@@ -25,13 +25,17 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="性别" prop="sex">
|
|
|
- <el-input
|
|
|
- placeholder="请输入访客名称"
|
|
|
- v-model="form.sex"
|
|
|
- disabled
|
|
|
- ></el-input>
|
|
|
+ <el-select v-model="form.sex" placeholder="请选择性别" style="width: 100%" disabled>
|
|
|
+ <el-option
|
|
|
+
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -52,17 +56,14 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- class="el-form-pack-12"
|
|
|
- label="拜访事由"
|
|
|
- prop="reason"
|
|
|
- >
|
|
|
+ <el-form-item label="访客公司" >
|
|
|
<el-input
|
|
|
- placeholder="请输入拜访事由"
|
|
|
- v-model="form.reason"
|
|
|
+ placeholder="请输入访客公司"
|
|
|
+ v-model="form.visitorCompany"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
class="el-form-pack-12"
|
|
@@ -79,30 +80,16 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
class="el-form-pack-12"
|
|
|
- label="访客部门"
|
|
|
+ label="被访部门"
|
|
|
prop="intervieweeDepartId"
|
|
|
>
|
|
|
<el-tree-select
|
|
|
v-model="form.intervieweeDepartId"
|
|
|
:data="departData"
|
|
|
:render-after-expand="false"
|
|
|
- style="width: 240px"
|
|
|
- @change="departChange"
|
|
|
- />
|
|
|
-
|
|
|
- <!-- <el-select
|
|
|
- v-model="form.intervieweeDepartId"
|
|
|
- placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
@change="departChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in departData"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select> -->
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -126,6 +113,18 @@
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ class="el-form-pack-12"
|
|
|
+ label="拜访事由"
|
|
|
+ prop="reason"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入拜访事由"
|
|
|
+ v-model="form.reason"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<el-button
|
|
@@ -147,9 +146,7 @@ import "@/assets/js/flexible.js";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
|
|
|
/*----------------------------------依赖引入-----------------------------------*/
|
|
|
-
|
|
|
import axios from "axios";
|
|
|
-
|
|
|
import { ref, reactive } from "vue";
|
|
|
/*----------------------------------组件引入-----------------------------------*/
|
|
|
import layout from "@/components/layout/index.vue";
|
|
@@ -173,7 +170,6 @@ const data = reactive({
|
|
|
mobilePhone: "",
|
|
|
},
|
|
|
rules: {
|
|
|
- // sex: [{ required: true, message: "请选择性别", trigger: "blur" }],
|
|
|
visitorName: [
|
|
|
{ required: true, message: "请输入访客名称", trigger: "blur" },
|
|
|
],
|
|
@@ -203,10 +199,21 @@ const data = reactive({
|
|
|
dateRange: [],
|
|
|
});
|
|
|
const timer = ref(null);
|
|
|
+const options = [
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label: '女',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '2',
|
|
|
+ label: '男',
|
|
|
+ }]
|
|
|
const certificateData = ref({});
|
|
|
const { form, rules, dateRange } = toRefs(data);
|
|
|
/*----------------------------------方法声明-----------------------------------*/
|
|
|
|
|
|
+
|
|
|
+/** 身份证数据读取 */
|
|
|
function getData() {
|
|
|
timer.value = setInterval(() => {
|
|
|
axios
|
|
@@ -215,15 +222,14 @@ function getData() {
|
|
|
)
|
|
|
.then((response) => {
|
|
|
form.value.visitorName = response.data.Certificate.Name;
|
|
|
- form.value.sex = response.data.Certificate.Sex;
|
|
|
+ form.value.sex = response.data.Certificate.Sex=='女'?'1':'2';
|
|
|
form.value.identityCardNo = response.data.Certificate.IDNumber;
|
|
|
-
|
|
|
- // certificateData.value=response.data.Certificate
|
|
|
})
|
|
|
.catch((error) => {});
|
|
|
}, 1000);
|
|
|
}
|
|
|
|
|
|
+/** 新增访客表单提交 */
|
|
|
function submitForm() {
|
|
|
if (dateRange.value == null) {
|
|
|
dateRange.value = [];
|
|
@@ -235,13 +241,15 @@ function submitForm() {
|
|
|
form.value.vistorEndTime = dateRange.value[1].replace("T", " ");
|
|
|
}
|
|
|
|
|
|
+ //模拟身份证数据读取
|
|
|
form.value.visitorName = "袁明明";
|
|
|
- form.value.sex = form.value.sex = "女" ;
|
|
|
+ form.value.sex = form.value.sex ='1';
|
|
|
form.value.identityCardNo = "411122199112078083";
|
|
|
+
|
|
|
+
|
|
|
proxy.$refs["formRef"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
-
|
|
|
- form.value.sex = form.value.sex == "女" ? 1 : 2;
|
|
|
+ form.value.sex = Number(form.value.sex);
|
|
|
form.value.accompanyNum = Number(form.value.accompanyNum);
|
|
|
addVisitor(form.value).then((requset) => {
|
|
|
if (requset.success == true) {
|
|
@@ -263,6 +271,7 @@ function submitForm() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+/** 获取访客部门树结构数据 */
|
|
|
function getDepartData() {
|
|
|
getOrganization({
|
|
|
pageIndex: 1,
|
|
@@ -270,7 +279,6 @@ function getDepartData() {
|
|
|
}).then((request) => {
|
|
|
console.log(request);
|
|
|
if (request.success == true) {
|
|
|
- // departData.value =request.result.item;
|
|
|
departData.value = JSON.parse(
|
|
|
JSON.stringify(request.result.item)
|
|
|
.replace(/name/g, "label")
|
|
@@ -294,11 +302,11 @@ function departChange(val) {
|
|
|
orgIds: [val],
|
|
|
},
|
|
|
}).then((request) => {
|
|
|
- var dataArray = request.result.item;
|
|
|
- dataArray.forEach(function (item, index) {
|
|
|
+ if (request.success == true) {
|
|
|
+ var dataArray = request.result.item;
|
|
|
+ dataArray.forEach(function (item, index) {
|
|
|
phoneArray.value.push(item.mobile1);
|
|
|
});
|
|
|
- if (request.success == true) {
|
|
|
} else {
|
|
|
ElMessage.error(request.msg);
|
|
|
}
|