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

物料新增修改

parent 2f698d8d
......@@ -6,7 +6,7 @@
<FormItem label="编码" prop="code">
<Input v-model="entity.code" placeholder="请输入" disabled></Input>
</FormItem>
</Col> -->
</Col>-->
<Col :span="12">
<FormItem label="名称" prop="name">
<Input v-model="entity.name" placeholder="请输入"></Input>
......@@ -22,7 +22,7 @@
:key="entity.status"
></Dictionary>
</FormItem>
</Col> -->
</Col>-->
<Col :span="12">
<FormItem label="版本" prop="version">
<Input v-model="entity.version" placeholder="请输入"></Input>
......@@ -33,28 +33,36 @@
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem>
</Col>
</Row>
<div>
<h4>扩展属性</h4>
<Divider orientation="left">扩展属性</Divider>
</div>
<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>
<InputNumber v-if="li.dataType==1||li.dataType==2" v-model="entity[li.field]" class="w100"></InputNumber>
<Input v-if="li.dataType==0" v-model="entity[li.field]"></Input>
<InputNumber
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==4" v-model="entity[li.filed]" ></Input>
<DatePicker v-if="li.dataType==5" v-model="entity[li.field]" type="date" :placeholder="'选择'+li.title" ></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]" ></InputFile>
<Input v-if="li.dataType==4" v-model="entity[li.filed]"></Input>
<DatePicker
v-if="li.dataType==5"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<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>
</FormItem>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</Col> -->
</Col>-->
<Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -75,7 +83,7 @@ export default {
entity: {
code: 0,
status: 0,
codeRuleId:this.nodeInfo.codeRuleId,
codeRuleId: this.nodeInfo.codeRuleId,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
......@@ -85,7 +93,7 @@ export default {
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
},
fileds:[]//扩展属性
fileds: [] //扩展属性
};
},
async fetch({ store, params }) {
......@@ -104,24 +112,28 @@ export default {
}
];
Api.listTable({ conditions: conditions ,sortBy:'id',isDesc:false}).then(r => {
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) {
this.fileds = r.result.filter(function(item) {
item.span=12;
if(item.dataType>4){
item.span=24
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
return item.fieldType!=1;
return item.fieldType != 1;
});
this.fileds.map(u=>{
let v='';
if(u.dataType==1||u.dataType==2){
v=0;
this.fileds.map(u => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.$set(this.entity.customProperties,u.filed,v)
this.$set(this.entity,u.filed,v)
})
this.$set(this.entity, u.filed, 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