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

物料新增修改

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