123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763 |
- <template>
- <div id="searchBoxNew">
- <div class="inputListBox" v-if="topType">
- <div class="fon_s">商品类型:</div>
- <div>
- <el-button
- :type="formData.goodsType === item.value ? 'primary' : ''"
- :size="size"
- v-for="(item, index) in lists"
- :key="index"
- @click="topSearch(item.value)"
- >{{ item.label }}</el-button
- >
- </div>
- </div>
- <div class="inputListBox" v-if="shType">
- <div class="fon_s">审核状态:</div>
- <div>
- <el-button
- :type="formData.status === item.value ? 'primary' : ''"
- :size="size"
- v-for="(item, index) in lists5"
- :key="index"
- @click="topSearchsh(item.value)"
- >{{ item.label }}</el-button
- >
- </div>
- </div>
- <!-- <div class="inputListBox" v-if="classType">
- <div>
- <el-button
- :type="formData.goodsType === item.value ? 'primary' : ''"
- :size="size"
- v-for="(item, index) in classLists"
- :key="index"
- @click="classSearch(item.value)"
- >{{ item.label }}</el-button
- >
- </div>
- </div> -->
- <div class="inputListBoxs">
- <div class="fon_sIcon" v-if="redIcon">
- <el-tooltip
- effect="light"
- class="item"
- content="该页面中的数据查询,针对的是「有效、有课程内容」的视频商品"
- placement="bottom-start"
- >
- <i class="el-icon-warning-outline iconStyS"></i>
- </el-tooltip>
- </div>
- <div
- class="fon_s"
- style="padding-top: 10px; width: 70px; text-align: end"
- v-else
- >
- 筛选:
- </div>
- <el-form :inline="true" :model="formData" class="tsxnz demo-form-inline">
- <el-form-item
- v-for="(item, index) in formListComput(formList)"
- :key="index"
- :label="item.label"
- >
- <!-- 教育类型 -->
- <el-select
- v-if="item.scope === 'educationType'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- @change="changeEducationType"
- >
- <el-option
- v-for="(items, indexs) in educationType"
- :key="indexs"
- :label="items.educationName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 业务层次 -->
- <el-select
- v-else-if="item.scope === 'businessLevel'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- @change="changeBusinessLevel"
- >
- <el-option
- v-for="(items, indexs) in newBusinessLevel"
- :key="indexs"
- :label="items.projectName + '-' + items.businessName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 院校 -->
- <el-select
- v-else-if="item.scope === 'schoolList'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in newSchoolList"
- :key="indexs"
- :label="items.schoolName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 专业-根据教育类型筛选 -->
- <el-select
- v-else-if="item.scope === 'Professional'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in newProfessional"
- :key="indexs"
- :label="items.categoryName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 专业 -->
- <el-select
- v-else-if="item.scope === 'ProfessionalList'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in Professional"
- :key="indexs"
- :label="items.categoryName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 科目 -->
- <el-select
- v-else-if="item.scope === 'sujectType'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in newSujectType"
- :key="indexs"
- :label="items.subjectName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 题目类型 -->
- <el-select
- v-else-if="item.scope === 'selectBank'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in optionsBank"
- :key="indexs"
- :label="items.label"
- :value="items.value"
- ></el-option>
- </el-select>
- <!-- 试卷类型 -->
- <el-select
- v-else-if="item.scope === 'paperType'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in paperType"
- :key="indexs"
- :label="items.label"
- :value="items.value"
- ></el-option>
- </el-select>
- <!-- 证书类型 -->
- <el-select
- v-else-if="item.scope === 'certificate'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in certificate"
- :key="indexs"
- :label="items.certificateName"
- :value="items.id"
- ></el-option>
- </el-select>
- <!-- 考试标题 -->
- <el-select
- v-else-if="item.scope === 'examList'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in examList"
- :key="indexs"
- :label="items.applyName"
- :value="items.applyId"
- ></el-option>
- </el-select>
- <!-- 考试地点 -->
- <el-select
- v-else-if="item.scope === 'applySiteAddress'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in applySiteAddress"
- :key="indexs"
- :label="items.siteAddress"
- :value="item.getType === 1 ? items.siteAddress : items.siteId"
- ></el-option>
- </el-select>
- <!-- 前培标题 -->
- <el-select
- v-else-if="item.scope === 'beforeList'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in beforeList"
- :key="indexs"
- :label="items.beforeName"
- :value="items.beforeId"
- ></el-option>
- </el-select>
- <!-- 自定义select -->
- <el-select
- :clearable="item.noClear === false ? false : true"
- v-else-if="item.scope === 'select'"
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- >
- <el-option
- v-for="(items, indexs) in item.options"
- :key="indexs"
- :label="items.label"
- :value="items.value"
- :disabled="items.disable"
- ></el-option>
- </el-select>
- <div v-else-if="item.scope === 'numList'">
- <el-input-number
- :controls="false"
- v-model="formData[item.prop1]"
- controls-position="right"
- :min="0"
- :max="100"
- :size="size"
- @change="
- handleChanges(formData[item.prop1], formData[item.prop2])
- "
- ></el-input-number
- >~
- <el-input-number
- :controls="false"
- v-model="formData[item.prop2]"
- controls-position="right"
- :min="0"
- :max="100"
- :size="size"
- @change="
- handleChanges(formData[item.prop1], formData[item.prop2])
- "
- ></el-input-number>
- </div>
- <el-input-number
- v-else-if="item.scope === 'inputNumber'"
- v-model="formData[item.prop]"
- controls-position="right"
- :min="0"
- :max="100"
- :size="size"
- ></el-input-number>
- <el-input
- v-else-if="item.scope === 'textarea' && formData[item.prop]"
- type="textarea"
- :size="size"
- readonly
- :rows="3"
- placeholder="请输入身份证"
- v-model="formData[item.prop]"
- >
- </el-input>
- <el-cascader
- v-else-if="item.scope === 'cascader'"
- v-model="formData[item.prop]"
- :options="item.options"
- :size="size"
- :props="{
- label: item.props.label,
- value: item.props.value,
- checkStrictly: true,
- emitPath: false,
- }"
- ></el-cascader>
- <el-cascader
- v-else-if="item.scope === 'cascaderDZ'"
- v-model="formData[item.prop]"
- :options="item.options"
- :size="size"
- :props="{
- label: item.props.label,
- value: item.props.value,
- checkStrictly: true,
- emitPath: false,
- }"
- clearable
- ></el-cascader>
- <el-date-picker
- v-else-if="item.scope === 'datePicker'"
- v-model="formData[item.prop]"
- type="datetimerange"
- :picker-options="pickerOptions"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- align="right"
- :size="size"
- value-format="timestamp"
- >
- </el-date-picker>
- <el-date-picker
- v-else-if="item.scope === 'datePickerA'"
- v-model="formData[item.prop]"
- type="datetime"
- :size="size"
- placeholder="选择日期时间"
- value-format="timestamp"
- >
- </el-date-picker>
- <div v-else-if="item.scope === 'moreDataPicker'">
- <el-date-picker
- v-model="formData[item.prop1]"
- :type="item.Diszing ? 'datetime':'date'"
- value-format="timestamp"
- :size="size"
- :placeholder="item.placeholder1"
- @change="change1(item.prop1, item.prop2)"
- >
- </el-date-picker>
- <el-date-picker
- style="margin-left: 10px"
- v-model="formData[item.prop2]"
- :type="item.Diszing ? 'datetime':'date'"
- :size="size"
- value-format="timestamp"
- :placeholder="item.placeholder2"
- @change="change2(item.prop1, item.prop2)"
- >
- </el-date-picker>
- </div>
- <el-input
- v-else-if="!item.scope"
- clearable
- v-model="formData[item.prop]"
- :placeholder="item.placeholder"
- :size="size"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button
- v-if="advanced"
- :size="size"
- type="success"
- @click="emitAdvanced"
- >{{ advancedName }}</el-button
- >
- <el-button :size="size" type="primary" @click="search"
- >查询</el-button
- >
- <el-button :size="size" @click="init">重置</el-button>
- </el-form-item>
- </el-form>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- export default {
- props: [
- "formList",
- "topType",
- "formData",
- "shType",
- "redIcon",
- "advanced",
- "advancedName",
- ], //参考文档 component.md
- data() {
- return {
- tireStatus: "", //当前选择的教育类型tireStatus
- lists: [
- {
- label: "全部",
- value: "",
- },
- {
- label: "视频",
- value: 1,
- },
- {
- label: "题库",
- value: 2,
- },
- {
- label: "补考",
- value: 3,
- },
- {
- label: "前培",
- value: 4,
- },
- ],
- lists5: [
- {
- label: "全部",
- value: "",
- },
- {
- label: "通过",
- value: 1,
- },
- {
- label: "待审核",
- value: 2,
- },
- {
- label: "不通过",
- value: 3,
- },
- ],
- // classLists: [
- // {
- // label: "全部",
- // value: "",
- // },
- // {
- // label: "二建继教",
- // value: 1,
- // },
- // {
- // label: "七大员继教",
- // value: 2,
- // },
- // {
- // label: "七大员新考",
- // value: 3,
- // },
- // ],
- paperType: [
- {
- label: "发布",
- value: 1,
- },
- {
- label: "未发布",
- value: 0,
- },
- ],
- optionsBank: [
- {
- label: "单选题",
- value: 1,
- },
- {
- label: "多选题",
- value: 2,
- },
- {
- label: "判断题",
- value: 3,
- },
- {
- label: "案例题",
- value: 4,
- },
- {
- label: "简答题",
- value: 5,
- },
- ], //题目类型
- size: "small", //输入框尺寸类型
- newBusinessLevel: [], //业务层次-筛选后的数据
- newSchoolList: [], //院校-筛选后的数据
- newProfessional: [], //专业-筛选后的数据
- newSujectType: [], //科目-筛选后的数据
- pickerOptions: {
- //日期选择器近期功能
- shortcuts: [
- {
- text: "最近一周",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近一个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近三个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit("pick", [start, end]);
- },
- },
- ],
- },
- };
- },
- computed: {
- ...mapGetters([
- "educationType",
- "Professional",
- "examList",
- "beforeList",
- "applySiteAddress",
- "certificate"
- ]),
- /**
- * @remarks 过滤选择器列表
- */
- formListComput: function () {
- return function (item) {
- var newOption = JSON.parse(JSON.stringify(item));
- const arrsy = newOption.filter((items) => {
- if (
- items.scope === "businessLevel" ||
- items.scope === "schoolList" ||
- items.scope === "Professional" ||
- items.scope === "sujectType"
- ) {
- if (!this.formData[items.edu]) {
- } else {
- const indexType = this.educationType.findIndex((its) => {
- return its.id === this.formData[items.edu];
- });
- if (
- items.scope === "businessLevel" &&
- this.educationType[indexType].tireStatus.indexOf("2") !== -1
- ) {
- return items;
- }
- if (
- items.scope === "schoolList" &&
- this.educationType[indexType].tireStatus.indexOf("3") !== -1
- ) {
- return items;
- }
- if (
- items.scope === "Professional" &&
- this.educationType[indexType].tireStatus.indexOf("4") !== -1
- ) {
- return items;
- }
- }
- } else {
- if (items.diff === "gfxs") {
- if (this.formData["studyStatus"] == 2) {
- return items;
- }
- } else {
- return items;
- }
- }
- });
- return arrsy;
- };
- },
- },
- methods: {
- /**
- * @remark 高级搜索
- */
- emitAdvanced() {
- this.$emit("Advanced", this.formData);
- },
- /**
- *
- * @param {int} data1
- * @param {int} data2
- * @remark 日期搜索-时间开始选择器触发
- */
- change1(data1, data2) {
- if (this.formData[data1]) {
- if (
- this.formData[data2] &&
- this.formData[data1] > this.formData[data2]
- ) {
- this.formData[data1] = "";
- this.$message.warning("开始时间不能大于结束时间,请重新选择开始时间");
- }
- }
- },
- /**
- *
- * @param {int} data1
- * @param {int} data2
- * @remark 日期搜索-时间结束选择器触发
- */
- change2(data1, data2) {
- if (this.formData[data2]) {
- if (
- this.formData[data1] &&
- this.formData[data2] < this.formData[data1]
- ) {
- this.formData[data2] = "";
- this.$message.warning("结束时间不能小于开始时间,请重新选择结束时间");
- }
- }
- },
- /**
- *
- * @param {int} status
- * @remark 顶部定制按钮-根据商品类型点击快速搜索
- */
- topSearch(status) {
- this.formData.goodsType = status;
- this.$emit("search", 3);
- },
- /**
- *
- * @param {int} status
- * @remark 顶部定制按钮-根据审核状态点击快速搜索
- */
- topSearchsh(types) {
- this.formData.status = types;
- this.$emit("search", 3);
- },
- /**
- * @remark 搜索
- */
- search() {
- this.$emit("search", 1);
- },
- /**
- * @remark 重置
- */
- init() {
- this.$emit("init");
- },
- /**
- *
- * @param {int} int1
- * @param {int} int2
- * @remark 数值取值范围选择器
- */
- handleChanges(int1, int2) {
- if (int1 !== undefined && int2 !== undefined) {
- if (int1 > int2) {
- this.$message.error("请规范输入取值范围");
- }
- }
- },
- /**
- *
- * @param {int} id
- * @remark 点击教育类型触发事件
- */
- changeEducationType(id) {
- const indexs = this.educationType.findIndex((item) => {
- return item.id === id;
- });
- this.tireStatus = this.educationType[indexs].tireStatus;
- if (this.formData.businessId) {
- this.formData.businessId = "";
- }
- if (this.formData.schoolId) {
- this.formData.schoolId = "";
- }
- if (this.formData.ProfessionalId) {
- this.formData.ProfessionalId = "";
- }
- if (this.formData.subjectId) {
- this.formData.subjectId = "";
- }
- this.$api
- .inquirebusinessList({ status: 1, educationId: id })
- .then((res) => {
- this.newBusinessLevel = res.rows;
- });
- this.$api
- .inquireUserSchool({ status: 1, educationId: id })
- .then((res) => {
- this.newSchoolList = res.rows;
- });
- this.$api
- .inquireCourseMajor({ status: 1, educationId: id })
- .then((res) => {
- this.newProfessional = res.rows;
- });
- this.$api
- .inquireCourseSubject({ status: 1, educationId: id })
- .then((res) => {
- this.newSujectType = res.rows;
- });
- },
- /**
- *
- * @param {int} id
- * @remark 点击业务层次触发事件
- */
- changeBusinessLevel(id) {},
- },
- };
- </script>
- <style lang="less" scoped>
- .fon_s {
- font-size: 14px;
- color: #6b6b6b;
- }
- .fon_sIcon {
- width: 50px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .iconStyS {
- font-size: 24px;
- font-weight: bold;
- color: red;
- }
- .inputListBox {
- display: flex;
- align-items: center;
- margin-bottom: 12px;
- }
- .inputListBoxs {
- display: flex;
- margin-bottom: 12px;
- }
- .tsxnz {
- flex: 1;
- /deep/ .el-form-item {
- margin-bottom: 0px;
- }
- }
- </style>
|