资质功能提交
parent
df4281c73d
commit
4ce83ce80e
@ -0,0 +1,47 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
|
||||
export function filterAuth(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udiwms/sup/auth/list",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function filterRelAuth(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udiwms/sup/auth/filterRel",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function batchAddAuth(query) {
|
||||
return axios({
|
||||
url: "/udiwms/sup/auth/batchAdd",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function deleteAuth(query) {
|
||||
return axios({
|
||||
url: "/udiwms/sup/auth//delete",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,47 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
|
||||
export function filterAuth(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udiwms/user/auth/list",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function filterRelAuth(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udiwms/user/auth/filterRel",
|
||||
method: "get",
|
||||
params: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function batchAddAuth(query) {
|
||||
return axios({
|
||||
url: "/udiwms/user/auth/batchAdd",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function deleteAuth(query) {
|
||||
return axios({
|
||||
url: "/udiwms/user/auth/delete",
|
||||
method: "post",
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,437 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<div>
|
||||
<el-form :model="filterQuery" size="mini" label-width="125px" v-show="showSearch">
|
||||
|
||||
<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="filterQuery[item.columnName]"
|
||||
: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 == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
|
||||
<el-select
|
||||
v-model="filterQuery[item.columnName]"
|
||||
:placeholder="item.columnDesc"
|
||||
@change="executeFuc($event,'5',item.checkRules)"
|
||||
:disabled="executeEval(null,item.disabledFuc,false)"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="item in options[item.clickFuc]"
|
||||
:key="item.code"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</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="searchList">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-bottom-left" @click="checkCombine"
|
||||
:loading="combineLoading"
|
||||
>选入
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
|
||||
<el-table
|
||||
:data="udidlList"
|
||||
style="width: 100%"
|
||||
border
|
||||
v-loading="loading"
|
||||
highlight-current-row="true"
|
||||
:row-class-name="tableRowClassName"
|
||||
@current-change="handleErpChange"
|
||||
@selection-change="handleSelectionUdiChange"
|
||||
>
|
||||
<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="filterQuery.page"
|
||||
:limit.sync="filterQuery.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {filterGroupRel, filterCompany} from "@/api/basic/product/udiInfo";
|
||||
import {superSearch} from "@/api/basic/udiInfo";
|
||||
import {filterRelAuth,batchAddAuth} from "@/api/sup/userCertAuth";
|
||||
import {executeFuc, getHead} from "@/utils/customConfig";
|
||||
|
||||
export default {
|
||||
name: "closeDialog",
|
||||
props: {
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
formName: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
inputQuery: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
filterQuery: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
cpmctymc1: "",
|
||||
combineLoading: false,
|
||||
combineQuery: {
|
||||
productId: null,
|
||||
ids: [],
|
||||
},
|
||||
checked: true,
|
||||
udidlList: [],
|
||||
erpList: [],
|
||||
pageTotal: 0,
|
||||
total: 0,
|
||||
tableHeader:[],
|
||||
queryList:[],
|
||||
fromList:[],
|
||||
currentRow: null,
|
||||
fromOptions: [],
|
||||
loading: false,
|
||||
erpLloading: false,
|
||||
multipleUdiSelection: [],
|
||||
selectDialog: false,
|
||||
diDetails: null,
|
||||
showSearch: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
this.actDateRange = [];
|
||||
this.udidlList = [];
|
||||
},
|
||||
clear() {
|
||||
this.filterQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
},
|
||||
searchList() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.filterQuery.productId = this.inputQuery.productIdFk;
|
||||
this.loading = true;
|
||||
filterRelAuth(this.filterQuery)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
if (response.code == 20000) {
|
||||
this.udidlList = response.data.list || [];
|
||||
this.total = response.data.total || 0;
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.udidlList = [];
|
||||
this.total = 0;
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
|
||||
keyup_submit(event) {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
event.target.select();
|
||||
},
|
||||
|
||||
checkSelectable(_this,row) {
|
||||
return !row.check;
|
||||
},
|
||||
|
||||
diDetail(row) {
|
||||
this.diDetails = row;
|
||||
this.selectDialog = true;
|
||||
},
|
||||
|
||||
handleCurrentChange(val) {
|
||||
this.filterQuery.page = val;
|
||||
this.getList();
|
||||
},
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
if (row.check) return "warning-row";
|
||||
return "";
|
||||
},
|
||||
handleErpChange(val) {
|
||||
this.cpmctymc1 = val.cpmctymc;
|
||||
this.currentRow = val;
|
||||
},
|
||||
intentBack() {
|
||||
this.closeDialog();
|
||||
},
|
||||
|
||||
checkCombine() {
|
||||
this.checkedUdi();
|
||||
},
|
||||
|
||||
checkedUdi() {
|
||||
let selectData = this.multipleUdiSelection;
|
||||
let selected = null;
|
||||
if (this.multipleUdiSelection.length == 0) {
|
||||
this.$message.warning('请选入产品!');
|
||||
return;
|
||||
} else {
|
||||
selectData.forEach((obj) => {
|
||||
if (obj.check) {
|
||||
selected = obj;
|
||||
}
|
||||
this.combineQuery.ids.push(obj.id);
|
||||
});
|
||||
}
|
||||
if (selected != null) {
|
||||
this.$message.warning("公司:" + selected.companyName + "已被选入");
|
||||
return;
|
||||
}
|
||||
this.combineLoading = true;
|
||||
this.combine();
|
||||
},
|
||||
|
||||
combine() {
|
||||
this.combineQuery.productId = this.inputQuery.productIdFk;
|
||||
batchAddAuth(this.combineQuery)
|
||||
.then((response) => {
|
||||
this.combineLoading = false;
|
||||
if (response.code == 20000) {
|
||||
this.intentBack();
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
this.intentBack();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.combineLoading = false;
|
||||
|
||||
this.$emit("closeUdi", false);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
handleSelectionUdiChange(val) {
|
||||
this.multipleUdiSelection = val;
|
||||
},
|
||||
executeFuc(row,type,clickFuc,value){
|
||||
return executeFuc(this,row,type,clickFuc,value);
|
||||
},
|
||||
executeEval(row,expression,defaultRet){
|
||||
if(expression){
|
||||
return eval(expression);
|
||||
}
|
||||
return defaultRet;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
created() {
|
||||
getHead("userEmpower-add","1").then((re) => {
|
||||
// 处理返回的数据
|
||||
this.tableObj = re.data;
|
||||
this.tableHeader = re.data.tableList;
|
||||
this.queryList = re.data.queryList;
|
||||
this.fromList = re.data.fromList;
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.checkitemTag {
|
||||
float: left;
|
||||
text-align: left;
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div /deep/ .el-table .warning-row {
|
||||
background: #bebebe;
|
||||
}
|
||||
|
||||
div /deep/ .el-table .success-row {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
margin-right: 20px;
|
||||
/*transition: all .5s;*/
|
||||
}
|
||||
|
||||
.query-form-item {
|
||||
display: block !important;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,437 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<div>
|
||||
<el-form :model="filterQuery" size="mini" label-width="125px" v-show="showSearch">
|
||||
|
||||
<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="filterQuery[item.columnName]"
|
||||
: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 == 'selectServer' && executeEval(row,item.expression,true)" :label="item.columnDesc+`:`">
|
||||
<el-select
|
||||
v-model="filterQuery[item.columnName]"
|
||||
:placeholder="item.columnDesc"
|
||||
@change="executeFuc($event,'5',item.checkRules)"
|
||||
:disabled="executeEval(null,item.disabledFuc,false)"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="(query) => executeFuc(query,'5',item.clickFuc)"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="item in options[item.clickFuc]"
|
||||
:key="item.code"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</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="searchList">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-bottom-left" @click="checkCombine"
|
||||
:loading="combineLoading"
|
||||
>选入
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
|
||||
<el-table
|
||||
:data="udidlList"
|
||||
style="width: 100%"
|
||||
border
|
||||
v-loading="loading"
|
||||
highlight-current-row="true"
|
||||
:row-class-name="tableRowClassName"
|
||||
@current-change="handleErpChange"
|
||||
@selection-change="handleSelectionUdiChange"
|
||||
>
|
||||
<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="filterQuery.page"
|
||||
:limit.sync="filterQuery.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {filterGroupRel, filterCompany} from "@/api/basic/product/udiInfo";
|
||||
import {superSearch} from "@/api/basic/udiInfo";
|
||||
import {filterRelAuth,batchAddAuth} from "@/api/purchase/supProductAuth";
|
||||
import {executeFuc, getHead} from "@/utils/customConfig";
|
||||
|
||||
export default {
|
||||
name: "closeDialog",
|
||||
props: {
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
formName: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
inputQuery: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
filterQuery: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
cpmctymc1: "",
|
||||
combineLoading: false,
|
||||
combineQuery: {
|
||||
productId: null,
|
||||
ids: [],
|
||||
},
|
||||
checked: true,
|
||||
udidlList: [],
|
||||
erpList: [],
|
||||
pageTotal: 0,
|
||||
total: 0,
|
||||
tableHeader:[],
|
||||
queryList:[],
|
||||
fromList:[],
|
||||
currentRow: null,
|
||||
fromOptions: [],
|
||||
loading: false,
|
||||
erpLloading: false,
|
||||
multipleUdiSelection: [],
|
||||
selectDialog: false,
|
||||
diDetails: null,
|
||||
showSearch: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
this.actDateRange = [];
|
||||
this.udidlList = [];
|
||||
},
|
||||
clear() {
|
||||
this.filterQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
},
|
||||
searchList() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.filterQuery.corpId = this.inputQuery.corpId;
|
||||
this.loading = true;
|
||||
filterRelAuth(this.filterQuery)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
if (response.code == 20000) {
|
||||
this.udidlList = response.data.list || [];
|
||||
this.total = response.data.total || 0;
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.udidlList = [];
|
||||
this.total = 0;
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
|
||||
keyup_submit(event) {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
event.target.select();
|
||||
},
|
||||
|
||||
checkSelectable(_this,row) {
|
||||
return !row.check;
|
||||
},
|
||||
|
||||
diDetail(row) {
|
||||
this.diDetails = row;
|
||||
this.selectDialog = true;
|
||||
},
|
||||
|
||||
handleCurrentChange(val) {
|
||||
this.filterQuery.page = val;
|
||||
this.getList();
|
||||
},
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
if (row.check) return "warning-row";
|
||||
return "";
|
||||
},
|
||||
handleErpChange(val) {
|
||||
this.cpmctymc1 = val.cpmctymc;
|
||||
this.currentRow = val;
|
||||
},
|
||||
intentBack() {
|
||||
this.closeDialog();
|
||||
},
|
||||
|
||||
checkCombine() {
|
||||
this.checkedUdi();
|
||||
},
|
||||
|
||||
checkedUdi() {
|
||||
let selectData = this.multipleUdiSelection;
|
||||
let selected = null;
|
||||
if (this.multipleUdiSelection.length == 0) {
|
||||
this.$message.warning('请选入产品!');
|
||||
return;
|
||||
} else {
|
||||
selectData.forEach((obj) => {
|
||||
if (obj.check) {
|
||||
selected = obj;
|
||||
}
|
||||
this.combineQuery.ids.push(obj.id);
|
||||
});
|
||||
}
|
||||
if (selected != null) {
|
||||
this.$message.warning("公司:" + selected.companyName + "已被选入");
|
||||
return;
|
||||
}
|
||||
this.combineLoading = true;
|
||||
this.combine();
|
||||
},
|
||||
|
||||
combine() {
|
||||
this.combineQuery.corpId = this.inputQuery.corpId;
|
||||
batchAddAuth(this.combineQuery)
|
||||
.then((response) => {
|
||||
this.combineLoading = false;
|
||||
if (response.code == 20000) {
|
||||
this.intentBack();
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
this.intentBack();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.combineLoading = false;
|
||||
|
||||
this.$emit("closeUdi", false);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
handleSelectionUdiChange(val) {
|
||||
this.multipleUdiSelection = val;
|
||||
},
|
||||
executeFuc(row,type,clickFuc,value){
|
||||
return executeFuc(this,row,type,clickFuc,value);
|
||||
},
|
||||
executeEval(row,expression,defaultRet){
|
||||
if(expression){
|
||||
return eval(expression);
|
||||
}
|
||||
return defaultRet;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
created() {
|
||||
getHead("supEmpower-add","1").then((re) => {
|
||||
// 处理返回的数据
|
||||
this.tableObj = re.data;
|
||||
this.tableHeader = re.data.tableList;
|
||||
this.queryList = re.data.queryList;
|
||||
this.fromList = re.data.fromList;
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.checkitemTag {
|
||||
float: left;
|
||||
text-align: left;
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div /deep/ .el-table .warning-row {
|
||||
background: #bebebe;
|
||||
}
|
||||
|
||||
div /deep/ .el-table .success-row {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
margin-right: 20px;
|
||||
/*transition: all .5s;*/
|
||||
}
|
||||
|
||||
.query-form-item {
|
||||
display: block !important;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue