修改bug

20240109-yw
yuanwei 1 year ago
parent 7ce0a0c483
commit 14afd561a5

@ -324,6 +324,24 @@
></pagination>
</el-card>
<el-dialog
:title="formAuthName"
:visible.sync="orderMutiSetAuthVisible"
:before-close="close"
width="60%"
v-if="orderMutiSetAuthVisible"
@close='closeAuthDialog'
:close-on-click-modal="false"
:modal-append-to-body="false"
:close-on-press-escape="false"
>
<certList
:closeDialog="closeAuthDialog"
:inputQuery="inputAuthQuery"
:formName="formAuthName"
></certList>
</el-dialog>
</div>
</template>
@ -333,10 +351,13 @@ import selectDetail from "./udilnfoManageSpDetail";
import {filterRlCompany, seachCompany,seachCompanyOptimize, deleteRel, updateRel} from "../../../../api/basic/udiRlCompany";
import ProductEdit from "@/views/basic/product/rel/productEdit";
import {executeFuc, getHead} from "@/utils/customConfig";
import certList from "./certList";
export default {
data() {
return {
formAuthName: "资质证书详情",
inputAuthQuery:{},
orderMutiSetAuthVisible: false,
showSearch: true,
filterQuery: {
unionCode: null,
@ -462,6 +483,16 @@ export default {
handleDetail(row) {
this.editQuery = row;
},
closeAuthDialog(){
this.orderMutiSetAuthVisible = false;
this.getBizDetailList();
},
detailOrderMutiAuth(_this,row){
_this.inputAuthQuery={
productIdFk:row.id
}
_this.orderMutiSetAuthVisible = true;
},
deleteOrders(data) {
this.loading = true;
let tquery = {
@ -600,7 +631,8 @@ export default {
,
components: {
selectLocalUdi,
selectDetail, ProductEdit
selectDetail, ProductEdit,
certList
}
,

@ -0,0 +1,277 @@
<template>
<div>
<el-card>
<el-form :model="inputQuery" label-width="150px" >
<template v-for="(itemRow, indexRow) in fromList">
<el-row :gutter="20" class="el-row" type="flex">
<template v-for="(item, index) in itemRow.list">
<el-col :span="item.width" class="el-col" type="flex">
<div class="text item">
<el-form-item v-if="item.columnType =='input'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-input
v-model="inputQuery[item.columnName]"
:style="item.style"
:size="item.size"
:type="item.inputType"
:placeholder="item.columnDesc"
:disabled="item.disabled"
@input="executeFuc($event,'5',item.clickFuc)"
></el-input>
</el-form-item>
<el-form-item v-if="item.columnType =='radio'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-radio-group :style="item.style" v-model="inputQuery[item.columnName]">
<el-radio
v-for="dict in item.lableRuleObj"
:key="parseInt(dict.value)"
:label="parseInt(dict.value)"
:disabled="item.disabled"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="item.columnType =='select'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-select :disabled="item.disabled" v-model="inputQuery[item.columnName]" :style="item.style">
<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'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-select
:style="item.style"
v-model="inputQuery[item.columnName]"
:placeholder="item.columnDesc"
@change="executeFuc($event,'5',item.clickFuc)"
:disabled="executeEval(null,item.disabledFuc,false) || item.disabled"
filterable
remote
:remote-method="(query) => executeFuc(query,'5',item.dataFuc)"
clearable>
<el-option
v-for="item in options[item.dataFuc]"
:key="item.code"
:label="item.label"
:value="item.code"
>
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.code
}}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-if="item.columnType =='date'" :rules="item.checkRulesObj" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<el-date-picker
v-model="inputQuery[item.columnName]"
:style="item.style"
value-format="yyyy-MM-dd"
:disabled="item.disabled"
type="date"
:placeholder="item.columnDesc"
></el-date-picker>
</el-form-item>
<el-form-item v-if="item.columnType =='treeCustom'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<treeselect
v-model="inputQuery[item.columnName]"
:options="menuOptions"
:normalizer="normalizer"
:show-count="true"
:placeholder="item.columnName"
/>
</el-form-item>
<el-form-item v-if="item.columnType =='custom'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<updateZz :inputQuery="inputQuery"
:formName="formName"
/>
</el-form-item>
</div>
</el-col>
</template>
</el-row>
</template>
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
<el-button @click="closeDialog"></el-button>
<el-button v-if="formName != 3" type="primary" @click="submitInv"></el-button>
</div>
</el-form>
</el-card>
</div>
</template>
<script>
import {saveYlqxzczh} from "@/api/purchase/supCert";
import {getCertType} from "@/api/purchase/supCertType";
import updateZz from "@/views/basic/client/product/updateZz";
import {
getHead,executeFuc
} from "@/utils/customConfig";
export default {
name: "companyPilotDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
formName: {
type: Object,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
tableHeader:[],
queryList:[],
fromList:[],
tableObj:[],
invList:[],
options: {
getCertTypeMethod:[],
},
uploadUrl: "",
fileList: [],
headers: {},
choiceFile: "选取文件",
option: {
img: this.inputQuery.filePath, //
info: false, // ()
outputSize: 0.9, // (0.1~1)
outputType: 'jpeg', // (jpg(jpg jpeg))
canScale: false, // (truefalse)
autoCrop: true, //
//
autoCropWidth: 0, //
autoCropHeight: 0, //
fixedBox: true, //
fixed: true, //
fixedNumber: [1, 1], // ([1,1][100,100])
full: true, //
canMove: true, //
canMoveBox: false, //
original: false, //
centerBox: false, //
infoTrue: true // true false
},
}
},
methods: {
submitInv(){
if(this.formName==1){
saveYlqxzczh(this.inputQuery,"add").then((response) => {
if(response.code == 20000){
this.closeDialog();
}else{
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error("添加失败");
});
}else if(this.formName==2){
saveYlqxzczh(this.inputQuery,"edit").then((response) => {
if(response.code == 20000){
this.closeDialog();
}else{
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error("添加失败");
});
}
},
executeFuc(row,type,clickFuc,value){
return executeFuc(this,row,type,clickFuc,value);
},
executeEval(row,expression,defaultRet){
if(expression){
return eval(expression);
}
return defaultRet;
},
getCertTypeMethod(_this,query) {
_this.fromOptions = [];
let cQuery = {
searchKey: query,
page: 1,
limit: 10,
};
getCertType(cQuery)
.then((response) => {
_this.loading = false;
_this.options.getCertTypeMethod = response.data || [];
})
.catch(() => {
_this.loading = false;
_this.options.findMethod= [];
});
},
change(_this) {
var pinyin = require("pinyin");
var py = pinyin(_this.inputQuery.companyName, {
style: pinyin.STYLE_FIRST_LETTER, //
heteronym: true,
});
var str = "";
py.forEach((item) => {
str = str + item[0];
});
_this.inputQuery.spell = str;
},
},
components: {
updateZz
},
created() {
var type = "supcert";
if(this.formName == 3){
type = "supcert-auth";
}
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
getHead(type,"1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
});
this.getCertTypeMethod(this);
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,458 @@
<template>
<div>
<el-card class="el-card">
<div>
<el-form v-if="queryList && queryList.length > 0" :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-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 == '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>
<el-dialog
:title="formCertMap[formCertName]"
:visible.sync="orderMutiSetCertVisible"
:before-close="close"
width="60%"
v-if="orderMutiSetCertVisible"
@close='closeCertDialog'
:close-on-click-modal="false"
:close-on-press-escape="false"
:append-to-body="true"
>
<ylqxzczhManuDialog
:closeDialog="closeCertDialog"
:inputQuery="inputCertQuery"
:formName="formCertName"
></ylqxzczhManuDialog>
</el-dialog>
</div>
</template>
<script>
import {filterMyAuth,batchAddAuth} from "@/api/purchase/supCert";
import {executeFuc, getHead} from "@/utils/customConfig";
import ylqxzczhManuDialog from "./certDetail";
export default {
name: "closeDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
formName: {
type: Object,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
},
data() {
return {
formCertName: 3,
formCertMap: {
3: "资质详情",
},
inputCertQuery:{},
orderMutiSetCertVisible: false,
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.detailProductIdFk = this.inputQuery.productIdFk;
this.loading = true;
filterMyAuth(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;
},
closeCertDialog(){
this.orderMutiSetCertVisible = false;
this.getList();
},
detailCertDialog(_this,row){
_this.formCertName=3;
_this.inputCertQuery=row
_this.orderMutiSetCertVisible = true;
},
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.name + "已被选入");
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: {
ylqxzczhManuDialog
},
created() {
getHead("supcert-auth","1").then((re) => {
//
this.tableObj = re.data;
this.tableHeader = re.data.tableList;
this.queryList = re.data.queryList;
this.fromList = re.data.fromList;
this.getList();
});
}
};
</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…
Cancel
Save