You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
146 lines
3.9 KiB
Vue
146 lines
3.9 KiB
Vue
2 years ago
|
<template>
|
||
|
<div>
|
||
|
<el-card>
|
||
|
<el-form :model="filterQuery" label-width="100px" size="mini">
|
||
|
<el-row>
|
||
|
<el-col :span="4">
|
||
|
<el-form-item label="模板名称:" class="query-form-item">
|
||
|
<el-input v-model="filterQuery.name" placeholder="请输入模板名称"></el-input>
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
<el-col :span="4">
|
||
|
<el-form-item label="模板编码:" class="query-form-item">
|
||
|
<el-input v-model="filterQuery.code" placeholder="请输入模板编码"></el-input>
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
<el-col :span="8">
|
||
|
<el-form-item>
|
||
|
<el-button-group>
|
||
|
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
|
||
|
<el-button type="primary" icon="search" @click="onSubmit">查询</el-button>
|
||
|
<el-button type="primary" icon="search" @click="combine">选入</el-button>
|
||
|
</el-button-group>
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
</el-row>
|
||
|
</el-form>
|
||
|
|
||
|
<el-table :data="list" border highlight-current-row style="width: 100%" >
|
||
|
<el-table-column width="50">
|
||
|
<template slot-scope="scope">
|
||
|
<el-radio v-model="radio" :label="scope.row.id" @change.native.stop="showRow(scope.row.id)"><span></span></el-radio>
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||
|
<el-table-column label="模板编码" prop="name" ></el-table-column>
|
||
|
<el-table-column label="模板名称" prop="code" ></el-table-column>
|
||
|
<el-table-column label="备注" prop="remark" ></el-table-column>
|
||
|
<el-table-column label="创建人" prop="createByName" ></el-table-column>
|
||
|
<el-table-column label="创建时间" prop="createTime" ></el-table-column>
|
||
|
</el-table>
|
||
|
|
||
|
<pagination
|
||
|
v-show="total>0"
|
||
|
:total="total"
|
||
|
:limit.sync="filterQuery.limit"
|
||
|
:page.sync="filterQuery.page"
|
||
|
@pagination="handleCurrentChange"
|
||
|
></pagination>
|
||
|
</el-card>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import {
|
||
|
addModeldestiny,
|
||
|
delectModeldestiny,
|
||
|
filterDestinyDelect,
|
||
|
getBasicDestinyfilter
|
||
|
} from "@/api/basic/basicDestinyRel";
|
||
|
import destinyModelEdit from "@/views/basic/destiny/destinyModelEdit";
|
||
|
import destinyModelSelectProduct from "@/views/basic/destiny/destinyModelSelectProduct";
|
||
|
import {isBlank} from "@/utils/strUtil";
|
||
|
|
||
|
|
||
|
export default {
|
||
|
props: {
|
||
|
closeDialog: {
|
||
|
type: Function,
|
||
|
required: true,
|
||
|
},
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
filterQuery: {
|
||
|
name: "",
|
||
|
code: "",
|
||
|
type: 2,
|
||
|
page: 1,
|
||
|
limit: 20
|
||
|
},
|
||
|
total: 0,
|
||
|
destinyId:null,
|
||
|
radio:null,
|
||
|
list: [],
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
onReset() {
|
||
|
this.$router.push({
|
||
|
path: ""
|
||
|
});
|
||
|
this.filterQuery = {
|
||
|
name: "",
|
||
|
code: "",
|
||
|
type: 2,
|
||
|
page: 1,
|
||
|
limit: 20
|
||
|
};
|
||
|
this.getList();
|
||
|
this.destinyId=null
|
||
|
},
|
||
|
onSubmit() {
|
||
|
this.$router.push({
|
||
|
path: "",
|
||
|
});
|
||
|
this.filterQuery.page = 1;
|
||
|
this.getList();
|
||
|
},
|
||
|
getList() {
|
||
|
this.loading = true;
|
||
|
getBasicDestinyfilter(this.filterQuery).then(response => {
|
||
|
this.loading = false;
|
||
|
this.list = response.data.list || [];
|
||
|
this.total = response.data.total || 0;
|
||
|
}).catch(() => {
|
||
|
this.loading = false;
|
||
|
this.list = [];
|
||
|
this.total = 0;
|
||
|
this.roles = [];
|
||
|
});
|
||
|
},
|
||
|
handleCurrentChange(val) {
|
||
|
this.filterQuery.page = val.page;
|
||
|
this.getList();
|
||
|
},
|
||
|
showRow (row) {
|
||
|
this.destinyId= row
|
||
|
},
|
||
|
combine(){
|
||
|
if(isBlank(this.destinyId)){
|
||
|
return this.$message.error("请先选择定数包!");
|
||
|
}
|
||
|
this.closeDialog(this.destinyId);
|
||
|
}
|
||
|
}
|
||
|
,
|
||
|
mounted() {
|
||
|
}
|
||
|
,
|
||
|
created() {
|
||
|
this.getList();
|
||
|
}
|
||
|
}
|
||
|
;
|
||
|
</script>
|