20240109-yw
wangwei 12 months ago
parent a637ea917f
commit 87b2d98e09

@ -0,0 +1,297 @@
<template>
<div>
<el-card>
<el-form :model="inputQuery" label-width="150px" ref="inputQuery">
<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}}
<!--{{item}}-->
</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.label"
:label="item.label"
:value="item.label"
>
<span style="float: left">{{ item.label }}</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>
<el-form-item v-if="item.columnType =='customtwo'" :prop="item.columnName">
<span slot="label">
{{item.columnDesc}}
</span>
<updatePdf :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('inputQuery')"></el-button>
</div>
</el-form>
</el-card>
</div>
</template>
<script>
import {saveYlqxzczh} from "@/api/sup/userCert";
import {getCertType} from "@/api/purchase/supCertType";
import updateZz from "@/views/basic/client/product/updateZz";
import {
getHead,executeFuc
} from "@/utils/customConfig";
import updatePdf from "@/views/basic/client/product/updatePdf";
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(inputQuery){
console.log("踩踩我是哪一个")
this.$refs[inputQuery].validate((valid) => {
if (valid) {
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("添加失败");
});
}
} else {
console.log('error submit!!');
return false;
}
});
},
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,updatePdf
},
created() {
var type = "client-usercert";
if(this.formName == 3){
type = "client-usercert-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>
Loading…
Cancel
Save