4/16 自动抽查设置主体 (记录小bug待修改)
parent
92b2b8e22e
commit
e34e03cce6
@ -0,0 +1,37 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
|
||||
|
||||
//查询
|
||||
export function listSet(query) {
|
||||
return axios({
|
||||
url: "/udi/autoSet/list",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 保存
|
||||
export function saveSet(data, formName, method = "post") {
|
||||
let url =
|
||||
formName !== "edit"
|
||||
? "/udi/autoSet/save"
|
||||
: "/udi/autoSet/edit";
|
||||
return axios({
|
||||
url: url,
|
||||
method: method,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 删除
|
||||
export function deleteSet(data) {
|
||||
return axios({
|
||||
url: "/udi/autoSet/delete",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
//查询 -- 后端controller 带写
|
||||
export function listSetDetail(query) {
|
||||
return axios({
|
||||
url: "/udi/autoSetDetail/list",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 保存
|
||||
export function saveSetDetail(data, formName, method = "post") {
|
||||
let url =
|
||||
formName !== "edit"
|
||||
? "/udi/autoSetDetail/save"
|
||||
: "/udi/autoSetDetail/edit";
|
||||
return axios({
|
||||
url: url,
|
||||
method: method,
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deleteSetDetail(data) {
|
||||
return axios({
|
||||
url: "/udi/autoSetDetail/delete",
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function getUdiProduct(query) {
|
||||
return axios({
|
||||
url: "/udi/autoSetDetail/getUdiProduct",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form :model="inputQuery" label-width="120px" >
|
||||
<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 v-model="inputQuery[item.columnName]" :style="item.style">
|
||||
<el-option
|
||||
v-for="dict in item.lableRuleObj"
|
||||
:key="parseInt(dict.value)"
|
||||
:label="dict.label"
|
||||
:value="parseInt(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
|
||||
v-model="inputQuery[item.columnName]"
|
||||
:placeholder="item.columnDesc"
|
||||
:style="item.style"
|
||||
@change="executeFuc($event,'5',item.clickFuc)"
|
||||
:disabled="executeEval(null,item.disabledFuc,false)"
|
||||
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"
|
||||
type="date"
|
||||
:placeholder="item.columnDesc"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="item.columnType =='datetime'" :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 HH:mm:ss"
|
||||
type="datetime"
|
||||
: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>
|
||||
</div>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-row>
|
||||
</template>
|
||||
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
|
||||
<el-button type="primary" @click="submitInv">提交</el-button>
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {saveSetDetail} from "@/api/udi/autoSetDetail";
|
||||
import {seachCompanyOptimize} from "@/api/basic/udiRlCompany.js";
|
||||
import {
|
||||
getHead,executeFuc
|
||||
} from "@/utils/customConfig";
|
||||
|
||||
export default {
|
||||
name: "ylqxzcrDialog",
|
||||
props: {
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
formName: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
inputQuery: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeader:[],
|
||||
queryList:[],
|
||||
fromList:[],
|
||||
tableObj:[],
|
||||
invList:[],
|
||||
options: {
|
||||
getYlqxzczh:[],
|
||||
findMethod:[]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitInv(){
|
||||
if(this.formName==1){
|
||||
saveSetDetail(this.inputQuery,"add").then((response) => {
|
||||
if(response.code == 20000){
|
||||
this.closeDialog();
|
||||
this.$message.error("添加成功");
|
||||
}else{
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("添加失败");
|
||||
});
|
||||
}else{
|
||||
saveSetDetail(this.inputQuery,"edit").then((response) => {
|
||||
if(response.code == 20000){
|
||||
this.closeDialog();
|
||||
this.$message.error("修改成功");
|
||||
}else{
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error("修改失败");
|
||||
});
|
||||
}
|
||||
},
|
||||
findMethod(_this,query) {
|
||||
_this.fromOptions = [];
|
||||
let cQuery = {
|
||||
searchKey: query,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
seachCompanyOptimize(cQuery)
|
||||
.then((response) => {
|
||||
_this.loading = false;
|
||||
_this.options.findMethod = response.data.list || [];
|
||||
})
|
||||
.catch(() => {
|
||||
_this.loading = false;
|
||||
_this.options.findMethod= [];
|
||||
});
|
||||
},
|
||||
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("auto-set-2","1").then((re) => {
|
||||
// 处理返回的数据
|
||||
this.tableObj = re.data;
|
||||
this.tableHeader = re.data.tableList;
|
||||
console.log("打印出当前的table列表",this.tableHeader)
|
||||
this.queryList = re.data.queryList;
|
||||
console.log("打印出当前的queryList列表",this.queryList)
|
||||
this.fromList = re.data.fromList;
|
||||
console.log("打印出当前的fromList列表",this.fromList)
|
||||
});
|
||||
this.findMethod(this)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue