fieldList
This commit is contained in:
parent
f80e491f12
commit
791b6606eb
|
@ -154,7 +154,7 @@
|
||||||
:title="tableForm.name"
|
:title="tableForm.name"
|
||||||
>
|
>
|
||||||
<customForm
|
<customForm
|
||||||
:results="fieldList.results"
|
:results="dialogFieldList"
|
||||||
:hasPicture="hasPicture"
|
:hasPicture="hasPicture"
|
||||||
:formID="formID"
|
:formID="formID"
|
||||||
:isDisabled="isDisabled"
|
:isDisabled="isDisabled"
|
||||||
|
@ -555,6 +555,7 @@
|
||||||
item:{},
|
item:{},
|
||||||
step: defaultstep,
|
step: defaultstep,
|
||||||
stepList: [],
|
stepList: [],
|
||||||
|
dialogFieldList: [],
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
@ -835,7 +836,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkValue() {
|
checkValue() {
|
||||||
this.field.field_key = this.field.field_key.replace(/[^a-zA-Z]/g, '');
|
this.field.field_key = this.field.field_key.replace(/[^0-9a-zA-Z]/g, '');
|
||||||
},
|
},
|
||||||
//添加字段选项
|
//添加字段选项
|
||||||
addDomain() {
|
addDomain() {
|
||||||
|
@ -852,9 +853,14 @@
|
||||||
that.listQueryfield.form = that.formID;
|
that.listQueryfield.form = that.formID;
|
||||||
getrffieldList(that.listQueryfield).then((response) => {
|
getrffieldList(that.listQueryfield).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.hasPicture = false;
|
|
||||||
that.fieldList = response.data;
|
that.fieldList = response.data;
|
||||||
let list = response.data.results;
|
}
|
||||||
|
});
|
||||||
|
getrffieldList({page:0,form:that.formID}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.hasPicture = false;
|
||||||
|
let list = response.data;
|
||||||
|
this.dialogFieldList= response.data;
|
||||||
let arr = list.filter(item => {
|
let arr = list.filter(item => {
|
||||||
return item.field_type === 'draw'
|
return item.field_type === 'draw'
|
||||||
});
|
});
|
||||||
|
@ -877,9 +883,6 @@
|
||||||
that.$set(that.checkForm, key, '')
|
that.$set(that.checkForm, key, '')
|
||||||
}
|
}
|
||||||
that.dialogVisibleForm = true;
|
that.dialogVisibleForm = true;
|
||||||
/* setTimeout(function () {
|
|
||||||
that.canvasInit();
|
|
||||||
}, 500);*/
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
that.fieldLists();
|
that.fieldLists();
|
||||||
|
|
|
@ -249,7 +249,7 @@
|
||||||
label-width="180px"
|
label-width="180px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
>
|
>
|
||||||
<el-row v-for="(item,$index) in fieldList.results" :key="$index">
|
<el-row v-for="(item,$index) in dialogFieldList" :key="$index">
|
||||||
<el-form-item v-if="item.field_type==='string'" :label="item.field_name">
|
<el-form-item v-if="item.field_type==='string'" :label="item.field_name">
|
||||||
<el-input placeholder="请输入"/>
|
<el-input placeholder="请输入"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -458,6 +458,7 @@
|
||||||
return {
|
return {
|
||||||
step: defaultstep,
|
step: defaultstep,
|
||||||
stepList: [],
|
stepList: [],
|
||||||
|
dialogFieldList: [],
|
||||||
productOptions: [],
|
productOptions: [],
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
|
@ -601,9 +602,14 @@
|
||||||
},
|
},
|
||||||
handleLook(scope) {
|
handleLook(scope) {
|
||||||
this.dialogVisibleForm = true;
|
this.dialogVisibleForm = true;
|
||||||
this.tableForm = Object.assign({}, scope.row); // copy obj
|
this.dialogFieldList = [];
|
||||||
|
this.tableForm = Object.assign({}, scope.row);
|
||||||
this.formID = this.tableForm.id;
|
this.formID = this.tableForm.id;
|
||||||
this.fieldLists();
|
getrffieldList({page:0,form:this.formID}).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.dialogFieldList = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
checkPermission,
|
checkPermission,
|
||||||
//子工序列表
|
//子工序列表
|
||||||
|
@ -638,7 +644,6 @@
|
||||||
this.step.instruction = null;
|
this.step.instruction = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
this.listQuery.page = 1;
|
this.listQuery.page = 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -659,6 +664,7 @@
|
||||||
this.$refs["Form"].clearValidate();
|
this.$refs["Form"].clearValidate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
rowClick(row) {
|
rowClick(row) {
|
||||||
this.stepid = row.id;
|
this.stepid = row.id;
|
||||||
this.recordformLists();
|
this.recordformLists();
|
||||||
|
@ -673,6 +679,7 @@
|
||||||
this.$refs["Form"].clearValidate();
|
this.$refs["Form"].clearValidate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDeleteStep(scope) {
|
handleDeleteStep(scope) {
|
||||||
this.$confirm("确认删除?", "警告", {
|
this.$confirm("确认删除?", "警告", {
|
||||||
confirmButtonText: "确认",
|
confirmButtonText: "确认",
|
||||||
|
@ -703,7 +710,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(this.step)
|
|
||||||
createStep(this.step).then((res) => {
|
createStep(this.step).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -717,11 +723,12 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCurrentChange(row) {
|
handleCurrentChange(row) {
|
||||||
this.formID = row.id;
|
this.formID = row.id;
|
||||||
this.fieldLists();
|
this.fieldLists();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
recordformLists() {
|
recordformLists() {
|
||||||
this.listQueryrecordform.step = this.stepid;
|
this.listQueryrecordform.step = this.stepid;
|
||||||
this.listQueryrecordform.type = 10;
|
this.listQueryrecordform.type = 10;
|
||||||
|
@ -729,7 +736,6 @@
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.recordformList = response.data;
|
this.recordformList = response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getFormList(){
|
getFormList(){
|
||||||
|
@ -737,18 +743,14 @@
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.formList = response.data;
|
this.formList = response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fieldLists() {
|
fieldLists() {
|
||||||
this.listQueryfield.form = this.formID
|
this.listQueryfield.form = this.formID;
|
||||||
getrffieldList(this.listQueryfield).then((response) => {
|
getrffieldList(this.listQueryfield).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.fieldList = response.data;
|
this.fieldList = response.data;
|
||||||
debugger;
|
|
||||||
console.log(this.fieldList)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//新增记录表
|
//新增记录表
|
||||||
|
@ -762,7 +764,6 @@
|
||||||
},
|
},
|
||||||
//新增字段
|
//新增字段
|
||||||
handlefieldCreate() {
|
handlefieldCreate() {
|
||||||
|
|
||||||
this.field_choice = [''];
|
this.field_choice = [''];
|
||||||
this.field = Object.assign({}, defaultfield);
|
this.field = Object.assign({}, defaultfield);
|
||||||
this.dialogType1 = "new";
|
this.dialogType1 = "new";
|
||||||
|
@ -773,8 +774,6 @@
|
||||||
},
|
},
|
||||||
handleEdit(scope) {
|
handleEdit(scope) {
|
||||||
this.recordform = Object.assign({}, scope.row); // copy obj
|
this.recordform = Object.assign({}, scope.row); // copy obj
|
||||||
debugger;
|
|
||||||
console.log(this.recordform);
|
|
||||||
this.dialogType = "edit";
|
this.dialogType = "edit";
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -798,7 +797,7 @@
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await deleterecordform(scope.row.id);
|
await deleterecordform(scope.row.id);
|
||||||
this.recordformLists()
|
this.recordformLists();
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@ -813,7 +812,7 @@
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await deleterffield(scope.row.id);
|
await deleterffield(scope.row.id);
|
||||||
this.fieldLists()
|
this.fieldLists();
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@ -834,11 +833,10 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.recordform.step = this.stepid
|
this.recordform.step = this.stepid;
|
||||||
|
|
||||||
createrecordform(this.recordform).then((res) => {
|
createrecordform(this.recordform).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.recordformLists()
|
this.recordformLists();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
|
@ -858,7 +856,7 @@
|
||||||
this.field.field_choice = this.field_choice;
|
this.field.field_choice = this.field_choice;
|
||||||
updaterffield(this.field.id, this.field).then((res) => {
|
updaterffield(this.field.id, this.field).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.fieldLists()
|
this.fieldLists();
|
||||||
this.dialogVisible1 = false;
|
this.dialogVisible1 = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
|
@ -868,7 +866,7 @@
|
||||||
this.field.field_choice = this.field_choice;
|
this.field.field_choice = this.field_choice;
|
||||||
createrffield(this.field).then((res) => {
|
createrffield(this.field).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.fieldLists()
|
this.fieldLists();
|
||||||
this.dialogVisible1 = false;
|
this.dialogVisible1 = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue