cyl/dev
parent
538fa78632
commit
69472a1173
@ -0,0 +1,271 @@
|
|||||||
|
<template>
|
||||||
|
<div class="">
|
||||||
|
<a-modal title="职教报名" v-model="show" :maskClosable="false" centered id="demo" @cancel="modalCancel" @ok="handleOk" width="640px" :destroyOnClose="true" class="detailWindow">
|
||||||
|
<a-form-model ref="ruleForm" :model="form" :colon="true" :rules="rules">
|
||||||
|
<a-form-model-item ref="proxy" label="代理" prop :wrapperCol="{ span: 16 }" :labelCol="{ span: 6 }" style="height: 30px; margin-bottom: 20px">
|
||||||
|
<div class="pzbox" style="width: 100%">
|
||||||
|
<span v-if="proxyStatus === ''">{{ proxyinfo.userName }}</span>
|
||||||
|
<a-select v-if="proxyStatus === 'proxy'" mode="combobox" auto-focus style="width: calc(100% - 200px)" placeholder="请选择代理" @blur="proxyStatus = ''">
|
||||||
|
<a-select-option v-for="i in proxyList" :key="i.userName" @click="proxyChange(i)">{{ i.userName }}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<span
|
||||||
|
@click="proxyStatus = 'proxy'"
|
||||||
|
:style="{
|
||||||
|
color: '#ff4400',
|
||||||
|
marginLeft: '10px',
|
||||||
|
cursor: 'pointer',
|
||||||
|
}"
|
||||||
|
v-if="proxyStatus !== 'proxy'"
|
||||||
|
>修改</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item ref="username" label=" 报名职教" prop="username" :wrapperCol="{ span: 16 }" :labelCol="{ span: 6 }" style="height: 30px; margin-bottom: 20px">
|
||||||
|
<!-- <a-input :value="firminfo.aliasName" :disabled="true" /> -->
|
||||||
|
<div class="pzbox" style="width: 100%">
|
||||||
|
<span v-if="storeStatus === ''">{{ form.aliasName }}</span>
|
||||||
|
<a-select v-if="storeStatus === 'store'" show-search auto-focus mode="combobox" placeholder="请选择企业" style="width: calc(100% - 200px)" :default-active-first-option="false" :show-arrow="false" :filter-option="false" :not-found-content="null" @search="storeSearch" @blur="storeStatus = ''">
|
||||||
|
<a-select-option v-for="i in storeList" :key="i.id + ''" @click="storeChange(i)">{{ i.aliasName }}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<span
|
||||||
|
@click="storeStatus = 'store'"
|
||||||
|
:style="{
|
||||||
|
color: '#ff4400',
|
||||||
|
marginLeft: '10px',
|
||||||
|
cursor: 'pointer',
|
||||||
|
}"
|
||||||
|
v-if="storeStatus !== 'store'"
|
||||||
|
>修改</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item ref="fuwufei" label="服务费" prop="fuwufei" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" style="margin-bottom: 20px">
|
||||||
|
<div class="" style="color:#ff4400">
|
||||||
|
{{ "800元/人" }}
|
||||||
|
</div>
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item ref="userName" label="姓名" prop="userName" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" style="margin-bottom: 20px">
|
||||||
|
<a-input v-model="form.userName" placeholder="请输入老乡姓名" class="special-input" />
|
||||||
|
</a-form-model-item>
|
||||||
|
<a-form-model-item ref="tel" label="手机号" prop="tel" :labelCol="{ span: 6 }" :wrapperCol="{ span: 16 }" style="margin-bottom: 20px">
|
||||||
|
<a-input v-model="form.tel" placeholder="请输入手机号" :max-length="11" />
|
||||||
|
</a-form-model-item>
|
||||||
|
|
||||||
|
<a-form-model-item ref="desp" style="margin-bottom: 12px" label="备注" prop="desp" :wrapperCol="{ span: 16 }" :labelCol="{ span: 6 }">
|
||||||
|
<a-textarea v-model="form.desp" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }" />
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-form-model>
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { recordBillApi, getProxyInfoApi, getStoreAliasApi, getStoreJobApi, getPolicyByJobIdApi, getPolicyListByJobIdApi, getJobDetailApi } from "@/api/job";
|
||||||
|
export default {
|
||||||
|
// 组件名称
|
||||||
|
name: "",
|
||||||
|
// 局部注册的组件
|
||||||
|
components: {},
|
||||||
|
// 组件参数 接收来自父组件的数据
|
||||||
|
props: {
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
jobDetail: {
|
||||||
|
type: Object,
|
||||||
|
default: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 组件状态值
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
proxyStatus: "",
|
||||||
|
storeStatus: "",
|
||||||
|
proxyList: [],
|
||||||
|
storeList: [],
|
||||||
|
proxyinfo: {},
|
||||||
|
form: {},
|
||||||
|
rules: {
|
||||||
|
// 录单校验规则
|
||||||
|
userName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入姓名",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern:
|
||||||
|
// /^((?![\u3000-\u303F])[\u2E80-\uFE4F]|·)*(?![\u3000-\u303F])[\u2E80-\uFE4F](·)*$/, // 姓名校验规则
|
||||||
|
/^(((?![\u3000-\u303F])[\u2E80-\uFE4F]|·)*(?![\u3000-\u303F])[\u2E80-\uFE4F][^·]{1,12})$/, // 姓名校验规则
|
||||||
|
message: "请输入正确的姓名",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tel: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入手机号",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
|
||||||
|
message: "请输入正确的手机号",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// tel: [{ required: true, message: "请输入手机号", trigger: "submit" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// 计算属性
|
||||||
|
computed: {},
|
||||||
|
// 侦听器
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.proxyinfo = JSON.parse(localStorage.getItem("LOGIN_DATA"));
|
||||||
|
console.log("this.proxyinfo", this.proxyinfo);
|
||||||
|
this.form.aliasName = this.jobDetail.aliasName;
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log("this.jobDetail", this.jobDetail);
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
// 组件方法
|
||||||
|
methods: {
|
||||||
|
modalCancel() {
|
||||||
|
this.$emit("update:show", false);
|
||||||
|
},
|
||||||
|
async storeSearch(value) {
|
||||||
|
// 企业名称搜索
|
||||||
|
console.log(value);
|
||||||
|
const { data } = await getStoreAliasApi(value);
|
||||||
|
if (data.status === 200) {
|
||||||
|
this.storeList = data.data;
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
var that = this;
|
||||||
|
console.log(that.fileListT2);
|
||||||
|
// let dataObj = {
|
||||||
|
// ...this.form,
|
||||||
|
// storeJobPolicyId: this.currentPolicy,
|
||||||
|
// storeJobId: this.firminfo.id,
|
||||||
|
// }
|
||||||
|
// console.log(dataObj);
|
||||||
|
this.$refs.ruleForm.validate(async (ispass, no) => {
|
||||||
|
console.log(this.form);
|
||||||
|
console.log(ispass);
|
||||||
|
console.log(no);
|
||||||
|
if (this.confirmLoading == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.confirmLoading = true;
|
||||||
|
if (ispass) {
|
||||||
|
console.log(this.form);
|
||||||
|
this.form["imgs"] = that.fileListT2.toString();
|
||||||
|
if (this.currentPolicy == 0) {
|
||||||
|
this.$message.warning("请选择政策");
|
||||||
|
this.confirmLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let dataObj = qs.stringify({
|
||||||
|
...this.form,
|
||||||
|
storeJobId: this.firminfo.id,
|
||||||
|
policyIdx: this.currentPolicy,
|
||||||
|
// policy: '',
|
||||||
|
});
|
||||||
|
console.log(dataObj);
|
||||||
|
const { data } = await recordBillApi(dataObj);
|
||||||
|
if (data.status === 200) {
|
||||||
|
console.log(data);
|
||||||
|
// this.$message.success("提交成功");
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false;
|
||||||
|
|
||||||
|
this.$router.push("/recordsuccess");
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
this.confirmLoading = false;
|
||||||
|
|
||||||
|
// setTimeout(() => {
|
||||||
|
// this.confirmLoading = false;
|
||||||
|
// this.form = {
|
||||||
|
// // 录单数据置空
|
||||||
|
// name: "",
|
||||||
|
// tel: "",
|
||||||
|
// peoplecard: "",
|
||||||
|
// username: "",
|
||||||
|
// };
|
||||||
|
// this.visible = false;
|
||||||
|
// }, 2000);
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false;
|
||||||
|
// this.$message.error(no)
|
||||||
|
|
||||||
|
console.log(123);
|
||||||
|
}
|
||||||
|
console.log(no);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
/deep/ .ant-modal {
|
||||||
|
.ant-btn-primary {
|
||||||
|
// width: 64px;
|
||||||
|
padding: 0 16px;
|
||||||
|
height: 32px;
|
||||||
|
// margin-top: 21px;
|
||||||
|
background: #ff4400;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: none;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
&:hover {
|
||||||
|
background-color: #ff4400cc;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
&::selection {
|
||||||
|
background: #ff4400;
|
||||||
|
}
|
||||||
|
&:focus {
|
||||||
|
background: #ff4400;
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
background: #ff4400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-btn {
|
||||||
|
// width: 64px;
|
||||||
|
padding: 0 16px;
|
||||||
|
height: 32px;
|
||||||
|
// margin-top: 21px;
|
||||||
|
border-radius: 6px;
|
||||||
|
// border: none;
|
||||||
|
font-size: 14px;
|
||||||
|
&:hover {
|
||||||
|
border-color: #ff4400cc;
|
||||||
|
color: #ff4400;
|
||||||
|
}
|
||||||
|
&::selection {
|
||||||
|
background: #ff4400;
|
||||||
|
}
|
||||||
|
&:focus {
|
||||||
|
background: #ff4400;
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
background: #ff4400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-modal-footer {
|
||||||
|
border-top: none;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue