|
@@ -1,66 +1,37 @@
|
|
|
<!-- 搜索表单 -->
|
|
<!-- 搜索表单 -->
|
|
|
<template>
|
|
<template>
|
|
|
- <el-form
|
|
|
|
|
- label-width="80px"
|
|
|
|
|
- class="ele-form-search"
|
|
|
|
|
- @keyup.enter.native="search"
|
|
|
|
|
- @submit.native.prevent
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-form label-width="80px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
|
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
|
<el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
|
|
<el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
|
|
|
<el-form-item label="计划编码:">
|
|
<el-form-item label="计划编码:">
|
|
|
<el-input clearable v-model="where.code" placeholder="请输入" />
|
|
<el-input clearable v-model="where.code" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
-
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
|
|
<el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
|
|
|
<el-form-item label="计划状态:" label-width="80px">
|
|
<el-form-item label="计划状态:" label-width="80px">
|
|
|
- <el-select
|
|
|
|
|
- v-model="where.statusList"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- class="w100"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in statusOpt[activeName]"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
|
|
+ <el-select v-model="where.statusList" placeholder="请选择" class="w100">
|
|
|
|
|
+ <el-option v-for="item in statusOpt[activeName]" :label="item.label" :value="item.value"
|
|
|
|
|
+ :key="item.value"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
|
|
<el-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
|
|
|
<el-form-item label="创建时间:">
|
|
<el-form-item label="创建时间:">
|
|
|
- <el-date-picker
|
|
|
|
|
- class="w100"
|
|
|
|
|
- v-model="where.createTime"
|
|
|
|
|
- type="daterange"
|
|
|
|
|
- range-separator="至"
|
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-date-picker class="w100" v-model="where.createTime" type="daterange" range-separator="至"
|
|
|
|
|
+ start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
- <el-col
|
|
|
|
|
- v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
|
|
|
<div class="ele-form-actions">
|
|
<div class="ele-form-actions">
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-search"
|
|
|
|
|
- class="ele-btn-icon"
|
|
|
|
|
- @click="search"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
|
|
|
查询
|
|
查询
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
|
|
|
|
|
- >重置</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button @click="reset" icon="el-icon-refresh-left" type="primary">重置</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -68,75 +39,75 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- export default {
|
|
|
|
|
- props: ['activeName', 'statusOpt', 'planType'],
|
|
|
|
|
- data () {
|
|
|
|
|
- // 默认表单数据
|
|
|
|
|
- const defaultWhere = {
|
|
|
|
|
-
|
|
|
|
|
|
|
+export default {
|
|
|
|
|
+ props: ['activeName', 'statusOpt',],
|
|
|
|
|
+ data() {
|
|
|
|
|
+ // 默认表单数据
|
|
|
|
|
+ const defaultWhere = {
|
|
|
|
|
|
|
|
- statusList: '',
|
|
|
|
|
- code: '',
|
|
|
|
|
- releaseTime: [],
|
|
|
|
|
- deliveryTime: [],
|
|
|
|
|
- createTime: []
|
|
|
|
|
- };
|
|
|
|
|
- return {
|
|
|
|
|
- // 表单数据
|
|
|
|
|
- where: { ...defaultWhere },
|
|
|
|
|
- treeData: []
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- computed: {
|
|
|
|
|
- // 是否开启响应式布局
|
|
|
|
|
- styleResponsive () {
|
|
|
|
|
- return this.$store.state.theme.styleResponsive;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- watch: {
|
|
|
|
|
- activeName: {
|
|
|
|
|
- handler () {
|
|
|
|
|
- if (this.activeName) {
|
|
|
|
|
- this.where.statusList = this.statusOpt[this.activeName][0].value;
|
|
|
|
|
- this.reset();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- immediate: true
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- created () {},
|
|
|
|
|
- methods: {
|
|
|
|
|
- /* 搜索 */
|
|
|
|
|
- search () {
|
|
|
|
|
- const where = { ...this.where };
|
|
|
|
|
|
|
|
|
|
- for (const key in where) {
|
|
|
|
|
- if (Array.isArray(where[key]) && where[key].length) {
|
|
|
|
|
- where[`${key}Start`] = where[key][0];
|
|
|
|
|
- where[`${key}End`] = where[key][1];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ statusList: '',
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ releaseTime: [],
|
|
|
|
|
+ deliveryTime: [],
|
|
|
|
|
+ createTime: []
|
|
|
|
|
+ };
|
|
|
|
|
+ return {
|
|
|
|
|
+ // 表单数据
|
|
|
|
|
+ where: { ...defaultWhere },
|
|
|
|
|
+ treeData: []
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ // 是否开启响应式布局
|
|
|
|
|
+ styleResponsive() {
|
|
|
|
|
+ return this.$store.state.theme.styleResponsive;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ activeName: {
|
|
|
|
|
+ handler() {
|
|
|
|
|
+ if (this.activeName) {
|
|
|
|
|
+ this.where.statusList = this.statusOpt[this.activeName][0].value;
|
|
|
|
|
+ this.reset();
|
|
|
}
|
|
}
|
|
|
- delete where.releaseTime;
|
|
|
|
|
- delete where.deliveryTime;
|
|
|
|
|
- delete where.createTime;
|
|
|
|
|
-
|
|
|
|
|
- where.statusList = where.statusList.split(',');
|
|
|
|
|
-
|
|
|
|
|
- this.$emit('search', where);
|
|
|
|
|
},
|
|
},
|
|
|
- /* 重置 */
|
|
|
|
|
- reset () {
|
|
|
|
|
- this.where = { ...this.defaultWhere };
|
|
|
|
|
- this.where.statusList = this.statusOpt[this.activeName][0].value;
|
|
|
|
|
- this.search();
|
|
|
|
|
|
|
+ immediate: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() { },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ /* 搜索 */
|
|
|
|
|
+ search() {
|
|
|
|
|
+ const where = { ...this.where };
|
|
|
|
|
+
|
|
|
|
|
+ for (const key in where) {
|
|
|
|
|
+ if (Array.isArray(where[key]) && where[key].length) {
|
|
|
|
|
+ where[`${key}Start`] = where[key][0];
|
|
|
|
|
+ where[`${key}End`] = where[key][1];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ delete where.releaseTime;
|
|
|
|
|
+ delete where.deliveryTime;
|
|
|
|
|
+ delete where.createTime;
|
|
|
|
|
+
|
|
|
|
|
+ where.statusList = where.statusList.split(',');
|
|
|
|
|
+
|
|
|
|
|
+ this.$emit('search', where);
|
|
|
|
|
+ },
|
|
|
|
|
+ /* 重置 */
|
|
|
|
|
+ reset() {
|
|
|
|
|
+ this.where = { ...this.defaultWhere };
|
|
|
|
|
+ this.where.statusList = this.statusOpt[this.activeName][0].value;
|
|
|
|
|
+ this.search();
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
- .ele-form-actions {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: flex-end;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.ele-form-actions {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|