Commit 5eb5fe2a authored by 周远喜's avatar 周远喜

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents a48ff697 2e82c336
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
key: "title", key: "title",
slot: "title" slot: "title"
}, },
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
align: "center", align: "center",
...@@ -160,14 +160,14 @@ export default { ...@@ -160,14 +160,14 @@ export default {
key: "required", key: "required",
align: "center", align: "center",
slot: "required", slot: "required",
width:80 width: 80
}, },
{ {
title: "唯一", title: "唯一",
key: "isUnique", key: "isUnique",
align: "center", align: "center",
slot: "isUnique", slot: "isUnique",
width:80 width: 80
}, },
{ {
width:80, width:80,
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
if (r.result) { if (r.result) {
var arr = r.result; var arr = r.result;
this.checkList = arr.filter(function(item) { this.checkList = arr.filter(function(item) {
item.mid=item.id; item.mid = item.id;
delete item["id"]; //删除属性id delete item["id"]; //删除属性id
return item.fieldType>1; return item.fieldType>1;
}); });
...@@ -238,15 +238,15 @@ export default { ...@@ -238,15 +238,15 @@ export default {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let maxId=0; let maxId = 0;
this.checkList.map(u=>{ this.checkList.map(u => {
if(u.mid>maxId){ if (u.mid > maxId) {
maxId=u.mid; maxId = u.mid;
} }
}) });
let obj = { let obj = {
mid:maxId+1, mid: maxId + 1,
field:"c"+maxId, field: "c" + maxId,
title: "", title: "",
note: "", note: "",
dataType: 0, dataType: 0,
...@@ -257,7 +257,7 @@ export default { ...@@ -257,7 +257,7 @@ export default {
action: 1, action: 1,
add: 0 //新增标识 add: 0 //新增标识
}; };
this.checkList.push(obj); this.checkList.unshift(obj);
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
...@@ -133,12 +133,12 @@ export default { ...@@ -133,12 +133,12 @@ export default {
key: "title", key: "title",
slot: "title" slot: "title"
}, },
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
align: "center", align: "center",
slot: "dataType", slot: "dataType",
width:150 width: 150
}, },
{ {
title: "备注", title: "备注",
...@@ -156,14 +156,14 @@ export default { ...@@ -156,14 +156,14 @@ export default {
key: "required", key: "required",
align: "center", align: "center",
slot: "required", slot: "required",
width:80 width: 80
}, },
{ {
title: "唯一", title: "唯一",
key: "isUnique", key: "isUnique",
align: "center", align: "center",
slot: "isUnique", slot: "isUnique",
width:80 width: 80
}, },
{ {
title: "操作", title: "操作",
...@@ -202,12 +202,16 @@ export default { ...@@ -202,12 +202,16 @@ export default {
fieldValue: this.nodeInfo.id fieldValue: this.nodeInfo.id
} }
]; ];
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) {
console.log(r); console.log(r);
r.result.map(u=>{ r.result.map(u => {
u.mid=u.id; u.mid = u.id;
}) });
this.checkList = r.result; this.checkList = r.result;
} }
}); });
...@@ -230,16 +234,16 @@ export default { ...@@ -230,16 +234,16 @@ export default {
setRow(row, index) { setRow(row, index) {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let maxId=0; let maxId = 0;
this.checkList.map(u=>{ this.checkList.map(u => {
if(u.mid>maxId){ if (u.mid > maxId) {
maxId=u.mid; maxId = u.mid;
} }
}) });
let obj = { let obj = {
mid:maxId+1, mid: maxId + 1,
field:"c"+maxId, field: "c" + maxId,
title: "", title: "",
note: "", note: "",
dataType: "0", dataType: "0",
...@@ -250,7 +254,7 @@ export default { ...@@ -250,7 +254,7 @@ export default {
action: 1, action: 1,
add: 0 //新增标识 add: 0 //新增标识
}; };
this.checkList.push(obj); this.checkList.unshift(obj);
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
...@@ -133,12 +133,14 @@ export default { ...@@ -133,12 +133,14 @@ export default {
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [],sortBy:'id',isDesc:false conditions: [],
sortBy: "id",
isDesc: false
}; };
Api.pagedSlecet(data).then(r => { Api.pagedSlecet(data).then(r => {
this.cityList = r.result.items; this.cityList = r.result.items;
this.downName=this.cityList[0].name; this.downName = this.cityList[0].name;
this.model8=this.cityList[0].id; this.model8 = this.cityList[0].id;
this.nodeInfo.codeRuleId = this.cityList[0].id; this.nodeInfo.codeRuleId = this.cityList[0].id;
this.loadTree(this.nodeInfo.codeRuleId); this.loadTree(this.nodeInfo.codeRuleId);
}); });
...@@ -271,10 +273,14 @@ export default { ...@@ -271,10 +273,14 @@ export default {
// } // }
}, },
loadTree(id) { loadTree(id) {
let conditions = [ let data = {
{ fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" } conditions: [
]; { fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" }
Api.list({ conditions: conditions }).then(r => { ],
sortBy: "code",
isDesc: false
};
Api.list(data).then(r => {
var data = this.$u.toTree( var data = this.$u.toTree(
r.result, r.result,
0, 0,
......
...@@ -121,7 +121,6 @@ export default { ...@@ -121,7 +121,6 @@ export default {
remove(id) { remove(id) {
Api.delete(id).then(r => { Api.delete(id).then(r => {
if (r.success) { if (r.success) {
this.$emit("on-ok");
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
this.$Message.success("删除成功"); this.$Message.success("删除成功");
} }
......
...@@ -22,35 +22,23 @@ ...@@ -22,35 +22,23 @@
<Filed :span="8" name="状态:"> <Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" /> <State code="materail.category.status" :value="parseInt(entity.status)" />
</Filed> </Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed> <Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed> <Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row> </Row>
<!-- <Divider /> <Divider orientation="left">扩展属性</Divider>
<div class="title-h4">engineering</div>
<Row> <Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed> <Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'">
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed> <State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed> <div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed> <div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed> <span v-else>{{entity[li.field]}}</span>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed> <span v-if="li.unitName" v-text="li.unitName" class="ml10"></span>
</Filed>
</Row> </Row>
<Divider />
<div class="title-h4">engineering</div>
<Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
</Row>-->
</div> </div>
</div> </div>
<div v-show="showTable"> <div v-show="showTable">
<DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750"></DataGrid> <DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750"></DataGrid>
<!-- <Table border :columns="columns" :data="data1" :height="800"></Table> -->
</div> </div>
</Content> </Content>
</Layout> </Layout>
...@@ -59,7 +47,7 @@ ...@@ -59,7 +47,7 @@
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
props: ["eid"], props: ["eid", "rootCategoryId"],
data() { data() {
return { return {
data1: [], data1: [],
...@@ -67,6 +55,7 @@ export default { ...@@ -67,6 +55,7 @@ export default {
isactive: 0, isactive: 0,
showFrom: true, showFrom: true,
showTable: false, showTable: false,
fileds: [],
rowId: this.eid, rowId: this.eid,
entity: {}, entity: {},
easySearch: { easySearch: {
...@@ -74,7 +63,7 @@ export default { ...@@ -74,7 +63,7 @@ export default {
tableTitle: { op: "Equal", value: "material" }, tableTitle: { op: "Equal", value: "material" },
tId: { tId: {
op: "Equal", op: "Equal",
value: this.$route.query.id value: this.eid
} }
}, },
listData: [ listData: [
...@@ -101,12 +90,43 @@ export default { ...@@ -101,12 +90,43 @@ export default {
}, },
mounted() { mounted() {
this.load(this.eid); this.load(this.eid);
this.initFiled();
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
if (r.result) { if (r.result) {
this.entity = r.result; this.entity = r.result;
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.rootCategoryId
}
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) {
this.fileds = r.result.filter(function(item) {
item.span = 8;
if (item.dataType == 8 || item.dataType == 5) {
item.span = 24;
}
return item.fieldType != 1;
});
this.fileds.map(u => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
this.$set(this.entity, u.filed, v);
});
}
});
} }
}); });
}, },
......
...@@ -13,8 +13,13 @@ ...@@ -13,8 +13,13 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择" v-if="entity.status==3||entity.status==2"> <FormItem
<Dictionary label="状态"
prop="status"
placeholder="请选择"
v-if="entity.status==3||entity.status==2"
>
<Dictionary
code="material.main.status" code="material.main.status"
v-model="entity.status" v-model="entity.status"
type="select" type="select"
...@@ -32,34 +37,43 @@ ...@@ -32,34 +37,43 @@
<FormItem label="描述" prop="description"> <FormItem label="描述" prop="description">
<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
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary> v-if="li.dataType==1||li.dataType==2"
<Input v-if="li.dataType==4" v-model="entity[li.filed]" ></Input> v-model="entity[li.field]"
<DatePicker v-if="li.dataType==5" v-model="entity[li.field]" type="date" :placeholder="'选择'+li.title" ></DatePicker> class="w100"
<InputFile v-if="li.dataType==6" v-model="entity[li.field]" ></InputFile> ></InputNumber>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> --> <Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<InputFile v-if="li.dataType==7" v-model="entity[li.field]" ></InputFile> <Input v-if="li.dataType==4" v-model="entity[li.filed]"></Input>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]" ></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>
</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>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Form> </Form>
</div> </div>
...@@ -78,7 +92,8 @@ export default { ...@@ -78,7 +92,8 @@ export default {
customProperties: {}, customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
}, },
checkList: [], fileds: [],
checkList: [],
disabled: false, disabled: false,
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }]
...@@ -89,13 +104,13 @@ export default { ...@@ -89,13 +104,13 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { created() {
this.initFiled(); this.initFiled();
}, },
mounted() { mounted() {
this.get(); this.get();
}, },
methods: { methods: {
initFiled() { initFiled() {
let conditions = [ let conditions = [
{ {
conditionalType: "Equal", conditionalType: "Equal",
...@@ -103,25 +118,28 @@ export default { ...@@ -103,25 +118,28 @@ export default {
fieldValue: this.nodeInfo.rootCategoryId fieldValue: this.nodeInfo.rootCategoryId
} }
]; ];
Api.listTable({
Api.listTable({ conditions: conditions ,sortBy:'id',isDesc:false}).then(r => { conditions: conditions,
if (r.result) { sortBy: "id",
isDesc: false
}).then(r => {
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);
}) });
} }
}); });
}, },
...@@ -132,7 +150,7 @@ export default { ...@@ -132,7 +150,7 @@ export default {
} }
}); });
}, },
tableData() { tableData() {
let conditions = [ let conditions = [
{ {
conditionalType: "In", conditionalType: "In",
...@@ -154,7 +172,7 @@ export default { ...@@ -154,7 +172,7 @@ export default {
if (r.result) { if (r.result) {
var arr = r.result; var arr = r.result;
this.checkList = arr.filter(function(item) { this.checkList = arr.filter(function(item) {
item.mid=item.id; item.mid = item.id;
delete item["id"]; //删除属性id delete item["id"]; //删除属性id
return item; return item;
}); });
......
...@@ -75,7 +75,8 @@ export default { ...@@ -75,7 +75,8 @@ export default {
nodeInfo: { nodeInfo: {
categoryId: 0, categoryId: 0,
rootCategoryId: 0, rootCategoryId: 0,
ids: [] ids: [],
addChange: true
}, },
downName: "请选择类型", downName: "请选择类型",
modal: false, modal: false,
...@@ -105,14 +106,16 @@ export default { ...@@ -105,14 +106,16 @@ export default {
} }
}); });
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [],sortBy:'id',isDesc:false conditions: [],
sortBy: "id",
isDesc: false
}; };
Api.pagedSlecet(data).then(r => { Api.pagedSlecet(data).then(r => {
this.cityList = r.result.items; this.cityList = r.result.items;
this.downName=this.cityList[0].name; this.downName = this.cityList[0].name;
this.model8=this.cityList[0].id; this.model8 = this.cityList[0].id;
this.nodeInfo.codeRuleId = this.cityList[0].id; this.nodeInfo.codeRuleId = this.cityList[0].id;
this.loadTree(this.nodeInfo.codeRuleId); this.loadTree(this.nodeInfo.codeRuleId);
}); });
...@@ -184,10 +187,14 @@ export default { ...@@ -184,10 +187,14 @@ export default {
} }
}, },
loadTree(id) { loadTree(id) {
let conditions = [ let data = {
{ fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" } conditions: [
]; { fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" }
Api.list({ conditions: conditions }).then(r => { ],
sortBy: "code",
isDesc: false
};
Api.list(data).then(r => {
var data = this.$u.toTree( var data = this.$u.toTree(
r.result, r.result,
0, 0,
...@@ -209,6 +216,11 @@ export default { ...@@ -209,6 +216,11 @@ export default {
} }
}, },
change(v, b) { change(v, b) {
if (b.level < b.ruleLevel && b.children.length > 0) {
this.nodeInfo.addChange = false;
} else {
this.nodeInfo.addChange = true;
}
let ids = []; let ids = [];
ids.push(b.value); ids.push(b.value);
if (b.children) { if (b.children) {
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<component <component
:is="detail" :is="detail"
:eid="curId" :eid="curId"
:rootCategoryId="rootCategoryId"
:rowsTable="rowsTable" :rowsTable="rowsTable"
:nodeInfo="nodeInfo" :nodeInfo="nodeInfo"
@on-close="cancel" @on-close="cancel"
...@@ -70,6 +71,7 @@ export default { ...@@ -70,6 +71,7 @@ export default {
modal: false, modal: false,
title: "新增", title: "新增",
curId: 0, curId: 0,
rootCategoryId: 0,
selectRows: [], selectRows: [],
rowsTable: [], rowsTable: [],
fullscreen: false, fullscreen: false,
...@@ -101,10 +103,10 @@ export default { ...@@ -101,10 +103,10 @@ export default {
{ {
props: {}, props: {},
on: { on: {
click: () => this.details(params.row.id) click: () => this.details(params.row)
} }
}, },
params.row.code !params.row.code ? "未分配" : params.row.code
); );
} }
}, },
...@@ -140,14 +142,14 @@ export default { ...@@ -140,14 +142,14 @@ export default {
{ {
key: "creationTime", key: "creationTime",
title: "创建时间", title: "创建时间",
hide: false, hide: true,
align: "left", align: "left",
type: "date" type: "date"
}, },
{ {
key: "creatorUserId", key: "creatorUserId",
title: "创建人", title: "创建人",
hide: false, hide: true,
align: "left", align: "left",
type: "user" type: "user"
}, },
...@@ -212,6 +214,7 @@ export default { ...@@ -212,6 +214,7 @@ export default {
methods: { methods: {
onSelect(a, b) { onSelect(a, b) {
//批量选择 //批量选择
this.rootCategoryId = a[0].rootCategoryId;
this.selectRows = a; this.selectRows = a;
}, },
modalSchedule() { modalSchedule() {
...@@ -274,11 +277,19 @@ export default { ...@@ -274,11 +277,19 @@ export default {
}); });
}, },
add() { add() {
this.fullscreen = false; if (this.nodeInfo.categoryId) {
this.curId = 0; if (this.nodeInfo.addChange == true) {
this.title = "新增"; this.fullscreen = false;
this.detail = () => import("./add"); this.curId = 0;
this.modal = true; this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
} else {
this.$Message.error("请在设置的分类层级数下添加物料");
}
} else {
this.$Message.error("请先选择分类");
}
}, },
edit(row) { edit(row) {
this.fullscreen = false; this.fullscreen = false;
...@@ -288,18 +299,17 @@ export default { ...@@ -288,18 +299,17 @@ export default {
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
alert(id);
Api.delete(id).then(r => { Api.delete(id).then(r => {
if (r.success) { if (r.success) {
this.$emit("on-ok");
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
this.$Message.success("删除成功"); this.$Message.success("删除成功");
} }
}); });
}, },
details(id) { details(row) {
this.fullscreen = true; this.fullscreen = true;
this.curId = id; this.curId = row.id;
this.rootCategoryId = row.rootCategoryId;
this.title = "详情"; this.title = "详情";
this.detail = () => import("./details"); this.detail = () => import("./details");
this.rowsTable = []; this.rowsTable = [];
...@@ -308,6 +318,7 @@ export default { ...@@ -308,6 +318,7 @@ export default {
send(row) { send(row) {
this.fullscreen = true; this.fullscreen = true;
this.curId = row.id; this.curId = row.id;
this.rootCategoryId = row.rootCategoryId;
this.title = "物料送审"; this.title = "物料送审";
this.detail = () => import("./submit"); this.detail = () => import("./submit");
this.rowsTable = []; this.rowsTable = [];
......
...@@ -3,20 +3,29 @@ ...@@ -3,20 +3,29 @@
<div class="body-procee"> <div class="body-procee">
<div class="new-detail" v-if="osrOneList1"> <div class="new-detail" v-if="osrOneList1">
<Row> <Row>
<Filed :span="8" name="编码:">{{entity.code}}</Filed> <Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed>
<Filed :span="8" name="名称:">{{entity.name}}</Filed> <Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" name="状态:"> <Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" /> <State code="materail.category.status" :value="parseInt(entity.status)" />
</Filed> </Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed> <Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed> <Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row> </Row>
<Divider orientation="left">扩展属性</Divider>
<Row>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'">
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<span v-else>{{entity[li.field]}}</span>
<span v-if="li.unitName" v-text="li.unitName" class="ml10"></span>
</Filed>
</Row>
</div> </div>
<Table <Table
:loading="loading" :loading="loading"
border border
:columns="columns" :columns="cols"
:data="dataList" :data="dataList"
class="tableCommon" class="tableCommon"
v-if="osrOneList2" v-if="osrOneList2"
...@@ -53,7 +62,7 @@ export default { ...@@ -53,7 +62,7 @@ export default {
components: { components: {
Process Process
}, },
props: ["eid", "rowsTable"], props: ["eid", "rootCategoryId", "rowsTable"],
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
...@@ -81,6 +90,7 @@ export default { ...@@ -81,6 +90,7 @@ export default {
codeList: [], //合格证编号List codeList: [], //合格证编号List
operatorIdList: [] //操作员id operatorIdList: [] //操作员id
}, //确定后返回数据 }, //确定后返回数据
cols: [],
columns: [ columns: [
{ {
key: "code", key: "code",
...@@ -141,6 +151,7 @@ export default { ...@@ -141,6 +151,7 @@ export default {
} else { } else {
this.osrOneList1 = false; this.osrOneList1 = false;
this.osrOneList2 = true; this.osrOneList2 = true;
this.getTable();
this.dataList = this.rowsTable; this.dataList = this.rowsTable;
} }
}, },
...@@ -158,10 +169,77 @@ export default { ...@@ -158,10 +169,77 @@ export default {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
if (r.result) { if (r.result) {
this.entity = r.result; this.entity = r.result;
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.rootCategoryId
}
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) {
this.fileds = r.result.filter(function(item) {
item.span = 8;
if (item.dataType == 8 || item.dataType == 5) {
item.span = 24;
}
return item.fieldType != 1;
});
this.fileds.map(u => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
this.$set(this.entity, u.filed, v);
});
}
});
} }
}); });
}, },
getTable() {
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.rootCategoryId
}
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) {
var items = r.result.filter(u => {
return (
!this.columns.some(p => {
return p.key == u.field;
}) && u.dataType != 5
);
});
this.cols = this.$u.clone(this.columns);
let extra = items.map(u => {
var col = {
key: u.field,
title: u.title
};
if (u.dataType == 3) {
col.code = u.note;
}
return col;
});
this.cols = this.cols.concat(extra);
var action = this.cols.splice(this.columns.length - 1, 1);
this.cols.push(this.columns[this.columns.length - 1]);
}
});
},
returnDataList() { returnDataList() {
let ues = this.$refs.userProcess; let ues = this.$refs.userProcess;
this.dataListRetrunNew.operatorIdList = ues.immutData; this.dataListRetrunNew.operatorIdList = ues.immutData;
...@@ -171,12 +249,12 @@ export default { ...@@ -171,12 +249,12 @@ export default {
}, },
upSave() { upSave() {
this.dataListRetrunNew.idList = [];
this.dataListRetrunNew.codeList = [];
let codeList = []; let codeList = [];
let idList = []; let idList = [];
idList.push(this.rowId);
codeList.push(this.entity.code);
if (this.eid !== 0) { if (this.eid !== 0) {
idList.push(this.rowId); idList.push(this.eid);
codeList.push(this.entity.code); codeList.push(this.entity.code);
} else { } else {
this.rowsTable.forEach(e => { this.rowsTable.forEach(e => {
......
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