genggai
parent
87b2d98e09
commit
241ff83934
@ -0,0 +1,583 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<!--搜索表单--待修改-->
|
||||
<el-form v-if="queryList && queryList.length > 0" :model="filterQuery" class="query-form" size="mini" label-width="120px" v-show="showSearch" :inline="true">
|
||||
<el-row style=" display:flex; flex-wrap: wrap; ">
|
||||
<template v-for="(item, index) in queryList" >
|
||||
<el-form-item v-if="item.columnType == 'input' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`" :key="item.id">
|
||||
<el-input
|
||||
v-model="input"
|
||||
:placeholder="item.columnDesc"
|
||||
:disabled="executeEval(null,item.disabledFuc,false)"
|
||||
@keyup.enter.native="executeFuc($event,'5',item.clickFuc)"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="item.columnType == 'select' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
|
||||
<el-select v-model="filterQuery[item.columnName]"
|
||||
:placeholder="item.columnDesc"
|
||||
:disabled="executeEval(null,item.disabledFuc,false)"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in item.lableRuleObj"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="item.columnType == 'datePicker' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
v-model="actDateRange"
|
||||
type="daterange"
|
||||
format="yyyy 年 MM 月 dd 日"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="item.columnType == 'date' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
|
||||
<el-date-picker
|
||||
v-model="filterQuery[item.columnName]"
|
||||
:style="`width:${item.width+'px'}`"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="executeEval(null,item.disabledFuc,false)"
|
||||
type="date"
|
||||
:placeholder="item.columnDesc"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!--状态栏-->
|
||||
<div class="top-right-btn">
|
||||
<el-button-group>
|
||||
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="onReset"
|
||||
>重置
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
|
||||
>查询
|
||||
</el-button
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="(event) => addDialog()">新增</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<!--表格-->
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
|
||||
@row-click="(row) => executeFuc(row,'0',tableObj.handleChangeFuc)">
|
||||
>
|
||||
<template v-for="(item, index) in tableHeader">
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
|
||||
type="index" :label="item.columnDesc"></el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'selection'"
|
||||
type="selection"
|
||||
:width="item.width"
|
||||
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
|
||||
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:width="item.width"
|
||||
:key="item.columnName"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
|
||||
:type="buttonItem.type"
|
||||
:size="buttonItem.size"
|
||||
:style="buttonItem.style"
|
||||
:key="buttonItem"
|
||||
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
|
||||
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
|
||||
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
|
||||
>{{ buttonItem.name }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="filterCertQuery.page"
|
||||
:limit.sync="filterCertQuery.limit"
|
||||
@pagination="handleCurrentChange"
|
||||
|
||||
></pagination>
|
||||
</el-card>
|
||||
<!----------------------------------------第二部分--------------------------------------->
|
||||
<el-card class="el-card">
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
<el-table v-loading="loadCertLoading" :data="manuCertList" style="width: 100%" ref="table"
|
||||
highlight-current-row border >
|
||||
<template v-for="(item, index) in tableHeader2">
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'id' && executeEval(row,item.expression,true)"
|
||||
type="index" :label="item.columnDesc"></el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'selection'"
|
||||
type="selection"
|
||||
:width="item.width"
|
||||
:selectable="(row,number) => executeFuc(row,'3',item.clickFuc)"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'radio' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'laber' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: executeFuc(scope.row,'4',item.lableRuleObj[scope.row[item.columnName]])}">{{ item.lableRuleObj[scope.row[item.columnName]] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'eltag' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="executeFuc(scope.row,'4',item,item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName])">
|
||||
<span>{{ item.lableRuleObj?item.lableRuleObj[scope.row[item.columnName]]:scope.row[item.columnName] }}</span>
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'button' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:width="item.width"
|
||||
:key="item.columnName"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button v-for="(buttonItem, buttonIndex) in item.buttonRulObj"
|
||||
:type="buttonItem.type"
|
||||
:size="buttonItem.size"
|
||||
:style="buttonItem.style"
|
||||
:key="buttonItem"
|
||||
v-if="executeEval(scope.row,buttonItem.hasPermi,true)"
|
||||
:disabled="executeEval(scope.row,buttonItem.disabledFuc,false)"
|
||||
@click.native.stop="executeFuc(scope.row,'1',buttonItem.clickFuc)"
|
||||
>{{ buttonItem.name }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="item.columnType == 'text' && executeEval(row,item.expression,true)"
|
||||
:prop="item.columnName"
|
||||
:label="item.columnDesc"
|
||||
:sortable="item.sort"
|
||||
:width="item.width"
|
||||
:show-overflow-tooltip="item.tooltip"
|
||||
:key="item.columnName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: executeFuc(scope.row,'4',item,scope.row[item.columnName])}">{{ scope.row[item.columnName] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</template>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!--新增/编辑自动抽查-->
|
||||
<el-dialog
|
||||
:title="formMap[formName]"
|
||||
:visible.sync="addDialogVisible"
|
||||
:before-close="close"
|
||||
width="60%"
|
||||
v-if="addDialogVisible"
|
||||
@close='closeAddDialog'
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<setAddDialog
|
||||
:closeDialog="closeAddDialog"
|
||||
:inputQuery="inputAddQuery"
|
||||
:formName="formAddName"
|
||||
></setAddDialog>
|
||||
</el-dialog>
|
||||
|
||||
<!--新增/编辑产品细节-->
|
||||
<el-dialog
|
||||
:title="formCertMap[formCertName]"
|
||||
:visible.sync="manuCertDialogVisible"
|
||||
:before-close="close"
|
||||
width="60%"
|
||||
v-if="manuCertDialogVisible"
|
||||
@close='closeCertDialog'
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<setDetailDialog
|
||||
:closeDialog="closeCertDialog"
|
||||
:inputQuery="inputCertQuery"
|
||||
:formName="formCertName"
|
||||
:rules="rules"
|
||||
></setDetailDialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import setAddDialog from "@/views/udi/trace/auto/setAddDialog";
|
||||
import {executeFuc, getHead} from "@/utils/customConfig";
|
||||
import {listSet,deleteSet} from "@/api/udi/autoSet";
|
||||
import setDetailDialog from "@/views/udi/trace/auto/setDetailDialog";
|
||||
import {deleteSetDetail, listSetDetail} from "@/api/udi/autoSetDetail";
|
||||
export default {
|
||||
// name
|
||||
data(){
|
||||
return{
|
||||
total: 0,
|
||||
queryList:[],
|
||||
queryList2:[],
|
||||
showSearch: true,
|
||||
filterQuery: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
filterCertQuery: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
formName: 1,
|
||||
formMap: {
|
||||
1: "新增抽查",
|
||||
2: "编辑抽查",
|
||||
},
|
||||
formCertName:1,
|
||||
formCertMap:{
|
||||
1:"新增产品",
|
||||
2:"编辑产品"
|
||||
},
|
||||
//table 表格
|
||||
list: [],
|
||||
tableHeader:[],
|
||||
loading: false,
|
||||
//table2
|
||||
loadCertLoading: false,
|
||||
changeCode:"",
|
||||
manuCertList: [],
|
||||
manuCertTotal: 0,
|
||||
actDateRange: [],
|
||||
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]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
inputAddQuery:{},
|
||||
formAddName:1,
|
||||
addDialogVisible: false,
|
||||
title : "新增配置",
|
||||
manuCertDialogVisible: false,
|
||||
inputCertQuery:{},
|
||||
}
|
||||
},
|
||||
components: {setDetailDialog,setAddDialog},
|
||||
methods : {
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.filterCertQuery.page = val.page;
|
||||
this.getList();
|
||||
},
|
||||
onSubmit() {
|
||||
if (this.actDateRange !== null) {
|
||||
this.filterQuery.startTime = this.actDateRange[0];
|
||||
this.filterQuery.endTime = this.actDateRange[1];
|
||||
} else {
|
||||
this.filterQuery.startTime = null;
|
||||
this.filterQuery.endTime = null;
|
||||
}
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
this.changeCode = "";
|
||||
this.manuCertList = [],
|
||||
this.manuCertTotal = 0
|
||||
},
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
this.getList();
|
||||
this.changeCode = "";
|
||||
this.manuCertList = [],
|
||||
this.manuCertTotal = 0
|
||||
},
|
||||
onCertReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterCertQuery = {
|
||||
setFk:this.setFk,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
this.getCertList();
|
||||
},
|
||||
supCertClick(_this,row) {
|
||||
_this.setFk= row.id
|
||||
_this.onCertReset();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSet(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;
|
||||
});
|
||||
},
|
||||
addCertMuti(){
|
||||
var setFk = this.setFk;
|
||||
if(!setFk){
|
||||
this.$message.error("请先选择企业");
|
||||
return;
|
||||
}
|
||||
this.inputCertQuery={
|
||||
setFk:setFk
|
||||
}
|
||||
this.formCertName=1;
|
||||
this.manuCertDialogVisible = true;
|
||||
},
|
||||
editCertDialog(_this,row){
|
||||
_this.formCertName=2;
|
||||
_this.inputCertQuery=row;
|
||||
_this.manuCertDialogVisible = true;
|
||||
},
|
||||
deleteCertDialog(_this,row) {
|
||||
_this.$confirm("确认删除吗?", "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
deleteSetDetail(row)
|
||||
.then((response) => {
|
||||
if(response.code == 20000){
|
||||
_this.$message.success("删除成功");
|
||||
_this.getCertList()
|
||||
}else{
|
||||
_this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
_this.$message.error(response.message);
|
||||
});
|
||||
});
|
||||
},
|
||||
getCertList() {
|
||||
this.filterCertQuery.cpmctymc = this.filterQuery.cpmctymc;
|
||||
this.filterCertQuery.ggxh = this.filterQuery.ggxh
|
||||
this.filterCertQuery.zczbhhzbapzbh = this.filterQuery.zczbhhzbapzbh
|
||||
this.filterCertQuery.companyName = this.filterQuery.companyName
|
||||
this.loadCertLoading = true;
|
||||
listSetDetail(this.filterCertQuery)
|
||||
.then((response) => {
|
||||
this.loadCertLoading = false;
|
||||
this.manuCertList = response.data.list || [];
|
||||
this.manuCertTotal = response.data.total || 0;
|
||||
})
|
||||
.catch(() => {
|
||||
this.filterCertQuery = false;
|
||||
this.manuCertList = [];
|
||||
this.manuCertTotal = 0;
|
||||
});
|
||||
},
|
||||
addDialog(){
|
||||
this.inputAddQuery={
|
||||
|
||||
}
|
||||
this.formName=1;
|
||||
this.addDialogVisible = true;
|
||||
},
|
||||
closeAddDialog(){
|
||||
this.addDialogVisible = false;
|
||||
this.getList();
|
||||
this.onCertReset();
|
||||
},
|
||||
executeFuc(row,type,clickFuc,value){
|
||||
return executeFuc(this,row,type,clickFuc,value);
|
||||
},
|
||||
executeEval(row,expression,defaultRet){
|
||||
if(expression){
|
||||
return eval(expression);
|
||||
}
|
||||
return defaultRet;
|
||||
},
|
||||
editDialog(_this,row){
|
||||
_this.formName=2;
|
||||
_this.inputAddQuery=row;
|
||||
_this.addDialogVisible = true;
|
||||
},
|
||||
deleteDialog(_this,row) {
|
||||
_this.$confirm("确认删除吗?", "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
deleteSet(row)
|
||||
.then((response) => {
|
||||
if(response.code == 20000){
|
||||
_this.getList()
|
||||
}else{
|
||||
_this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
_this.$message.error(response.message);
|
||||
});
|
||||
});
|
||||
},
|
||||
closeCertDialog(){
|
||||
this.manuCertDialogVisible = false;
|
||||
this.getCertList();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
//
|
||||
getHead("stat-set-1","1").then((re) => {
|
||||
// 处理返回的数据
|
||||
this.tableObj = re.data;
|
||||
this.tableHeader = re.data.tableList;
|
||||
this.queryList = re.data.queryList;
|
||||
this.fromList = re.data.fromList;
|
||||
this.getList()
|
||||
});
|
||||
|
||||
|
||||
getHead("auto-set-2","1").then((re) => {
|
||||
// 处理返回的数据
|
||||
this.tableObj2 = re.data;
|
||||
this.tableHeader2 = re.data.tableList;
|
||||
this.queryList2 = re.data.queryList;
|
||||
this.fromList2 = re.data.fromList;
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue