Commit daabb5f2 authored by 仇晓婷's avatar 仇晓婷

物料编辑bug

parent 77b1cf7c
......@@ -27,7 +27,11 @@
</Col>
<Col :span="24">
<FormItem label="描述" prop="description">
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
<Input
v-model="entity.description"
type="textarea"
placeholder="请输入..."
></Input>
</FormItem>
</Col>
</Row>
......@@ -37,26 +41,44 @@
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input v-if="li.dataType==0" v-model="entity[li.field]"></Input>
<Input v-if="li.dataType == 0" v-model="entity[li.field]"></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-if="li.dataType == 1 || li.dataType == 2"
v-model="entity[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<Dictionary
v-if="li.dataType == 3"
v-model="entity[li.field]"
:code="li.note"
></Dictionary>
<Input
v-if="li.dataType == 5"
type="textarea"
v-model="entity[li.filed]"
></Input>
<DatePicker
v-if="li.dataType==4"
v-if="li.dataType == 4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
:placeholder="'选择' + li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
<InputFile
v-if="li.dataType == 6"
v-model="entity[li.field]"
></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<InputFile
v-if="li.dataType == 7"
v-model="entity[li.field]"
></InputFile>
<Input
v-if="li.dataType == 8"
type="textarea"
v-model="entity[li.field]"
></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
......@@ -66,7 +88,7 @@
<!-- <Col :span="24">
<div v-html="entity"></div>
</Col>-->
<Col :span="24" style="text-align: right;">
<Col :span="24" style="text-align: right">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
......@@ -106,9 +128,7 @@ export default {
created() {
this.initFiled();
},
mounted() {
this.get();
},
mounted() {},
methods: {
initFiled() {
let conditions = [
......@@ -141,6 +161,7 @@ export default {
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
this.get();
}
});
},
......@@ -152,49 +173,9 @@ export default {
}
});
},
tableData() {
let conditions = [
{
conditionalType: "In",
fieldName: "fieldType",
fieldValue: "1,2",
},
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: "0",
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false,
}).then((r) => {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function (item) {
item.mid = item.id;
delete item["id"]; //删除属性id
return item;
});
}
});
},
remove(index, row) {
// if (row.add == 0) {
// //新增的删除,直接删
// this.checkList.splice(index, 1);
// } else {
// row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
// this.$set(this.checkList, index, row);
// this.arr.push(row);
// this.checkList.splice(index, 1);
// }
},
setRow(row, index) {
this.$set(this.checkList, index, row);
},
// setRow(row, index) {
// this.$set(this.checkList, index, row);
// },
handleSubmit() {
this.$refs.form.validate((v) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment