Commit e4fa1ce2 authored by 佟礼's avatar 佟礼

数据填报合并

parents 24e35bbc 28524808
...@@ -429,7 +429,7 @@ export default { ...@@ -429,7 +429,7 @@ export default {
let v = conditions[u].value; let v = conditions[u].value;
let op = conditions[u].op; let op = conditions[u].op;
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
if (op == "Range") { if (op == "Range"&&Array.isArray(v)) {
let times = []; let times = [];
v.map(u => { v.map(u => {
if (!this.$u.isNull(u)) { if (!this.$u.isNull(u)) {
...@@ -437,7 +437,7 @@ export default { ...@@ -437,7 +437,7 @@ export default {
} }
}); });
v = times.join(","); v = times.join(",");
} else if (op.indexOf("In") > -1) { } else if (op.indexOf("In") > -1&&Array.isArray(v)) {
v = v.join(","); v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
...@@ -544,6 +544,14 @@ export default { ...@@ -544,6 +544,14 @@ export default {
}, },
height() { height() {
this.tableHeight = this.height; this.tableHeight = this.height;
},
"columns.length"(){
this.columns.forEach(u => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
} }
} }
}; };
......
<template> <template>
<div> <div>
<span v-if="type=='date'">{{value.substr(0,10)}}</span> <span v-if="type=='date'">
<Tooltip :content="value">
{{value.substr(0,10)}}
</Tooltip>
</span>
<span v-else>{{value.substr(0,19)}}</span> <span v-else>{{value.substr(0,19)}}</span>
</div> </div>
</template> </template>
......
...@@ -30,51 +30,55 @@ ...@@ -30,51 +30,55 @@
</Col> </Col>
<Col :span="24"> <Col :span="24">
<h4>扩展属性</h4> <h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList" height="300"> <Table border :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input <Input
v-if="row.fieldType==3" v-if="row.fieldType==3"
v-model="row.title" v-model="row.title"
placeholder="请输入" placeholder="请输入名称"
@on-blur="setRow(row,index)" @on-blur="setRow(row,index)"
/> />
</template> </template>
<template slot-scope="{ row, index }" slot="note"> <template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div> <!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else /> <Select
v-if="row.dataType==3"
v-model="row.note"
clearable
transfer
v-else
@on-change="setRow(row,index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="dataType">
<state <Dictionary
v-if="row.fieldType==1" @on-change="setRow(row,index)"
code="materail.category.dataType" v-model="row.dataType"
:value="row.dataType" code="materail.category.dataType"
type="text" type="select"
></state> :value="row.dataType"
<Dictionary :key="row.dataType"
v-else ></Dictionary>
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
:value="row.dataType"
:key="row.dataType"
></Dictionary>
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="unitName">
<!-- <state
v-if="row.fieldType==1"
code="materail.main.company"
:value="row.company"
type="text"
></state> -->
<Dictionary <Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)" @on-change="setRow(row,index)"
v-model="row.company" v-model="row.unitName"
code="materail.main.company" code="material.main.unitName"
type="select" type="select"
:value="row.company" placeholder="请选择单位"
:key="row.company" :value="row.unitName"
:key="row.unitName"
></Dictionary> ></Dictionary>
</template> </template>
<template slot-scope="{ row, index }" slot="required"> <template slot-scope="{ row, index }" slot="required">
...@@ -118,6 +122,7 @@ export default { ...@@ -118,6 +122,7 @@ export default {
codeRuleId: this.nodeInfo.codeRuleId codeRuleId: this.nodeInfo.codeRuleId
}, },
disabled: false, disabled: false,
codeList: [],
columns: [ columns: [
{ {
title: "序号", title: "序号",
...@@ -128,43 +133,46 @@ export default { ...@@ -128,43 +133,46 @@ export default {
{ {
title: "属性名称", title: "属性名称",
key: "title", key: "title",
align: "center",
slot: "title" slot: "title"
}, },
{ {
title: "备注", title: "属性类型",
key: "note", key: "dataType",
align: "center", align: "center",
slot: "note" slot: "dataType",
width:200
}, },
{ {
title: "属性类型", title: "设置",
key: "dataType", key: "note",
align: "center", align: "center",
slot: "dataType" slot: "note",
}, },
{ {
title: "单位", title: "单位",
key: "company", key: "unitName",
align: "center", align: "center",
slot: "company" slot: "unitName",
width: "150"
}, },
{ {
title: "是否必填", title: "必填",
key: "required", key: "required",
align: "center", align: "center",
slot: "required" slot: "required",
width: 80
}, },
{ {
title: "是否唯一属性", title: "唯一",
key: "isUnique", key: "isUnique",
align: "center", align: "center",
slot: "isUnique" slot: "isUnique",
width: 80
}, },
{ {
width:80,
title: "操作", title: "操作",
slot: "action", slot: "action",
width: 100,
align: "center" align: "center"
} }
], ],
...@@ -177,7 +185,7 @@ export default { ...@@ -177,7 +185,7 @@ export default {
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { created() {
this.tableData(); this.tableData();
}, },
methods: { methods: {
...@@ -203,11 +211,17 @@ export default { ...@@ -203,11 +211,17 @@ 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;
delete item["id"]; //删除属性id delete item["id"]; //删除属性id
return item; return item.fieldType>1;
}); });
} }
}); });
Api.getChildren({ id: 582 }).then(r => {
if (r.result) {
this.codeList = r.result;
}
});
}, },
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
...@@ -224,10 +238,18 @@ export default { ...@@ -224,10 +238,18 @@ export default {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let maxId = 0;
this.checkList.map(u => {
if (u.mid > maxId) {
maxId = u.mid;
}
});
let obj = { let obj = {
mid: maxId + 1,
field: "c" + maxId,
title: "", title: "",
note: "", note: "",
dataType: "", dataType: 0,
required: false, required: false,
isunique: false, isunique: false,
fieldType: 3, fieldType: 3,
...@@ -235,7 +257,7 @@ export default { ...@@ -235,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 => {
......
...@@ -26,5 +26,7 @@ export default { ...@@ -26,5 +26,7 @@ export default {
delete(id) { delete(id) {
return Api.delete(`${systemUrl}/category/delete`,{params:{id:id}}); return Api.delete(`${systemUrl}/category/delete`,{params:{id:id}});
}, },
getChildren(params){
return Api.get(`${systemUrl}/Dictionary/getChildren`,params); //字典
},
} }
\ No newline at end of file
<template> <template>
<div> <div class="p10">
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12"> <!-- <Col :span="12">
...@@ -29,59 +29,76 @@ ...@@ -29,59 +29,76 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<h4>属性配置</h4> <h4>扩展属性</h4>
</Col> <Table border :columns="columns" :data="checkList">
<Col :span="24" style="padding:20px 0 0px 10px;margin-bottom:10px;" class="table-solt">
<!--fieldType 1.固有,2.默认,3自定义; -->
<Table border :columns="columns" :data="checkList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input v-else v-model="row.title" placeholder="请输入" @on-blur="setRow(row,index)" /> <Input
v-if="row.fieldType==3"
v-model="row.title"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
/>
</template> </template>
<template slot-scope="{ row, index }" slot="note"> <template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div> <!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else /> <Select
v-if="row.dataType==3"
v-model="row.note"
clearable
transfer
v-else
@on-change="setRow(row,index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="dataType">
<state <Dictionary
v-if="row.fieldType==1" @on-change="setRow(row,index)"
code="materail.category.dataType" v-model="row.dataType"
:value="row.dataType" code="materail.category.dataType"
type="text" type="select"
></state> :value="row.dataType"
:key="row.dataType"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary <Dictionary
v-else v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)" @on-change="setRow(row,index)"
v-model="row.dataType" v-model="row.unitName"
code="materail.category.dataType" code="material.main.unitName"
type="select" type="select"
:value="row.dataType" placeholder="请选择单位"
:key="row.dataType" :value="row.unitName"
:key="row.unitName"
></Dictionary> ></Dictionary>
</template> </template>
<!-- <template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>-->
<template slot-scope="{ row, index }" slot="required"> <template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox> <Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
</template> </template>
<template slot-scope="{ row, index }" slot="isUnique"> <template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox> <Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
</template> </template>
<template <template
slot-scope="{ row, index }" slot-scope="{ row, index }"
slot="action" slot="action"
v-if="row.fieldType==2||row.fieldType==3||!row.notEditDelete" v-if="row.fieldType==2||row.fieldType==3"
> >
<!-- notEditDelete=true,删除不显示 -->
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a> <a @click="remove(index,row)" style="color:#FF7A8B">删除</a>
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
</Col> </Col>
<Col :span="24" style="margin-bottom:20px;"> <Col :span="24" class="tr mt10">
<Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col>
<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>
...@@ -114,43 +131,44 @@ export default { ...@@ -114,43 +131,44 @@ export default {
{ {
title: "属性名称", title: "属性名称",
key: "title", key: "title",
align: "center",
slot: "title" slot: "title"
}, },
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 150
},
{ {
title: "备注", title: "备注",
key: "note", key: "note",
align: "center",
slot: "note" slot: "note"
}, },
{ {
title: "属性类型", title: "单位",
key: "dataType", key: "unitName",
align: "center", align: "center",
slot: "dataType" slot: "unitName"
}, },
// {
// title: "是否显示",
// key: "result",
// align: "center",
// slot: "result"
// },
{ {
title: "是否必填", title: "必填",
key: "required", key: "required",
align: "center", align: "center",
slot: "required" slot: "required",
width: 80
}, },
{ {
title: "是否唯一属性", title: "唯一",
key: "isunique", key: "isUnique",
align: "center", align: "center",
slot: "isunique" slot: "isUnique",
width: 80
}, },
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
width: 100, width: 80,
align: "center" align: "center"
} }
], ],
...@@ -184,12 +202,24 @@ export default { ...@@ -184,12 +202,24 @@ export default {
fieldValue: this.nodeInfo.id fieldValue: this.nodeInfo.id
} }
]; ];
Api.listTable({ conditions: conditions }).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 => {
u.mid = u.id;
});
this.checkList = r.result; this.checkList = r.result;
} }
}); });
Api.getChildren({ id: 582 }).then(r => {
if (r.result) {
this.codeList = r.result;
}
});
}, },
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
...@@ -205,20 +235,26 @@ export default { ...@@ -205,20 +235,26 @@ export default {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let arr = this.$u.clone(this.checkList); let maxId = 0;
this.checkList.map(u => {
if (u.mid > maxId) {
maxId = u.mid;
}
});
let obj = { let obj = {
mid: maxId + 1,
field: "c" + maxId,
title: "", title: "",
note: "", note: "",
dataType: "", dataType: "0",
required: false, required: false,
isunique: false, isunique: false,
fieldType: 3, fieldType: 3,
categoryId: 0, categoryId: 0,
action: 1, action: 1,
add: 0 add: 0 //新增标识
}; };
arr.push(obj); this.checkList.unshift(obj);
this.checkList = arr;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<MasterData ref="dataTable" @on-edit="editRow" :root="root" @on-ok="ok" /> <MasterData ref="dataTable" @on-edit="editRow" :root="root" @on-ok="ok" />
</Content> </Content>
</Layout> </Layout>
<Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false"> <Modal v-model="modal" :title="title" width="1500" footer-hide :mask-closable="false">
<component <component
:is="detail" :is="detail"
:eid="curId" :eid="curId"
...@@ -133,10 +133,16 @@ export default { ...@@ -133,10 +133,16 @@ export default {
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [] 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.model8 = this.cityList[0].id;
this.nodeInfo.codeRuleId = this.cityList[0].id;
this.loadTree(this.nodeInfo.codeRuleId);
}); });
}, },
...@@ -267,10 +273,14 @@ export default { ...@@ -267,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,
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
}, },
methods: { methods: {
search() { search() {
alert(JSON.stringify(this.easySearch)); // alert(JSON.stringify(this.easySearch));
console.log(this.easySearch); console.log(this.easySearch);
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
...@@ -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("删除成功");
} }
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<Input v-model="upName" placeholder="请输入" disabled></Input> <Input v-model="upName" placeholder="请输入" disabled></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<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>
......
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
<div> <div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12"> <!-- <Col :span="12">
<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>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择"> <FormItem label="状态" prop="status" placeholder="请选择">
<Dictionary <Dictionary
code="materail.category.status" code="material.main.status"
v-model="entity.status" v-model="entity.status"
type="select" type="select"
:value="entity.status" :value="entity.status"
: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,6 +33,37 @@ ...@@ -33,6 +33,37 @@
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input> <Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<div>
<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>
<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-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>
<state v-if="li.unitName" :value="li.unitName" code="material.main.unitName" type="tag"></state>
</FormItem>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</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>
...@@ -53,6 +84,7 @@ export default { ...@@ -53,6 +84,7 @@ export default {
entity: { entity: {
code: 0, code: 0,
status: 0, status: 0,
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
...@@ -61,40 +93,51 @@ export default { ...@@ -61,40 +93,51 @@ export default {
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }]
} },
fileds: [] //扩展属性
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { created() {
// this.tableData(); this.initFiled();
}, },
methods: { methods: {
// tableData() { initFiled() {
// let conditions = [ let conditions = [
// { {
// conditionalType: "In", conditionalType: "Equal",
// fieldName: "fieldType", fieldName: "categoryId",
// fieldValue: "1,2" fieldValue: this.nodeInfo.rootCategoryId
// }, }
// { ];
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: "0"
// }
// ];
// Api.listTable({ conditions: conditions }).then(r => { Api.listTable({
// if (r.result) { conditions: conditions,
// var arr = r.result; sortBy: "id",
// this.checkList = arr.filter(function(item) { isDesc: false
// delete item["id"]; }).then(r => {
// return item; if (r.result) {
// }); this.fileds = r.result.filter(function(item) {
// } item.span = 12;
// }); if (item.dataType > 4) {
// }, item.span = 24;
}
delete item["id"];
return item.fieldType != 1;
});
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);
});
}
});
},
remove(index, row) { remove(index, row) {
if (row.add == 0) { if (row.add == 0) {
//新增的删除,直接删 //新增的删除,直接删
......
...@@ -11,14 +11,17 @@ export default { ...@@ -11,14 +11,17 @@ export default {
list(params){ list(params){
return Api.post(`${systemUrl}/category/list`,params); return Api.post(`${systemUrl}/category/list`,params);
}, },
listTable(params){
return Api.post(`${systemUrl}/custompropertydefinition/list`,params);
},
get(params){ get(params){
return Api.get(`${systemUrl}/material/get`,params); return Api.get(`${systemUrl}/material/get`,params);
}, },
create(params){ create(params){
return Api.post(`${systemUrl}/material/create`,params); return Api.post(`${systemUrl}/material/createnew`,params);
}, },
update(params){ update(params){
return Api.post(`${systemUrl}/material/update`,params); return Api.post(`${systemUrl}/material/updatenew`,params);
}, },
delete(id) { delete(id) {
return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}}); return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}});
......
<template> <template>
<div class="maseter"> <div class="maseter">
<div class="come-back" @click="back">
<Icon type="ios-undo-outline" />返回
</div>
<Layout class="data-details"> <Layout class="data-details">
<Sider hide-trigger class="left-detail" width="300"> <Sider hide-trigger class="left-detail" width="300">
<h4 class="bt">标题</h4> <h4 class="bt">标题</h4>
...@@ -25,35 +22,23 @@ ...@@ -25,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>
...@@ -62,21 +47,23 @@ ...@@ -62,21 +47,23 @@
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
props: ["eid", "rootCategoryId"],
data() { data() {
return { return {
data1: [], data1: [],
action: Api.lists, action: Api.lists,
isactive: null, isactive: 0,
showFrom: false, showFrom: true,
showTable: false, showTable: false,
rowId: "", fileds: [],
rowId: this.eid,
entity: {}, entity: {},
easySearch: { easySearch: {
keys: { op: "title", value: "" }, keys: { op: "title", value: "" },
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,13 +88,46 @@ export default { ...@@ -101,13 +88,46 @@ export default {
] ]
}; };
}, },
created() { mounted() {
this.rowId = this.$route.query.id; this.load(this.eid);
this.initFiled();
}, },
methods: { methods: {
back() { load(v) {
this.$router.push({ Api.get({ id: v }).then(r => {
path: "/materiel/masterData" if (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);
});
}
});
}
}); });
}, },
everyItem(li, i) { everyItem(li, i) {
...@@ -115,35 +135,11 @@ export default { ...@@ -115,35 +135,11 @@ export default {
if (li.lable == "属性") { if (li.lable == "属性") {
this.showFrom = true; this.showFrom = true;
this.showTable = false; this.showTable = false;
this.load(this.eid);
Api.get({ id: this.rowId }).then(r => {
if (r.result) {
this.entity = r.result;
}
});
} else { } else {
this.showFrom = false; this.showFrom = false;
this.showTable = true; this.showTable = true;
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
// this.easySearch = {
// conditions: [
// {
// fieldName: "table",
// fieldValue: "material",
// conditionalType: "Equal"
// },
// {
// fieldName: "tId",
// fieldValue: this.rowId,
// conditionalType: "Equal"
// }
// ]
// };
// Api.categoryList(this.easySearch).then(r => {
// if (r.result) {
// this.data1 = r.result;
// }
// });
} }
}, },
l(key) { l(key) {
...@@ -154,20 +150,6 @@ export default { ...@@ -154,20 +150,6 @@ export default {
}; };
</script> </script>
<style lang="less" > <style lang="less" >
.maseter {
.come-back {
margin: 5px;
color: #2680eb;
.ivu-icon {
font-size: 20px;
}
}
.come-back:hover {
font-weight: bold;
cursor: pointer;
}
}
.ivu-layout { .ivu-layout {
background-color: #f5f7f9 !important; background-color: #f5f7f9 !important;
} }
...@@ -179,7 +161,7 @@ export default { ...@@ -179,7 +161,7 @@ export default {
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
margin-right: 10px; margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 86vh; height: 90vh;
overflow: auto; overflow: auto;
.bt { .bt {
height: 50px; height: 50px;
...@@ -214,7 +196,7 @@ export default { ...@@ -214,7 +196,7 @@ export default {
padding: 10px 15px; padding: 10px 15px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 86vh; height: 90vh;
overflow: auto; overflow: auto;
.btn { .btn {
text-align: right; text-align: right;
......
...@@ -13,9 +13,14 @@ ...@@ -13,9 +13,14 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择"> <FormItem
label="状态"
prop="status"
placeholder="请选择"
v-if="entity.status==3||entity.status==2"
>
<Dictionary <Dictionary
code="materail.category.status" code="material.main.status"
v-model="entity.status" v-model="entity.status"
type="select" type="select"
:value="entity.status" :value="entity.status"
...@@ -33,6 +38,36 @@ ...@@ -33,6 +38,36 @@
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input> <Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row>
<div>
<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>
<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>
<!-- <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>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</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>
...@@ -46,7 +81,7 @@ ...@@ -46,7 +81,7 @@
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
props: ["nodeInfo",'eid'], props: ["nodeInfo", "eid"],
data() { data() {
return { return {
arr: [], arr: [],
...@@ -57,6 +92,8 @@ export default { ...@@ -57,6 +92,8 @@ export default {
customProperties: {}, customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
}, },
fileds: [],
checkList: [],
disabled: false, disabled: false,
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }] name: [{ required: true, message: "必填", trigger: "blur" }]
...@@ -66,10 +103,46 @@ export default { ...@@ -66,10 +103,46 @@ export default {
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() {
this.initFiled();
},
mounted() { mounted() {
this.get(); this.get();
}, },
methods: { methods: {
initFiled() {
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.rootCategoryId
}
];
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;
}
delete item["id"];
return item.fieldType != 1;
});
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);
});
}
});
},
get() { get() {
Api.get({ id: this.eid }).then(r => { Api.get({ id: this.eid }).then(r => {
if (r.result) { if (r.result) {
...@@ -77,9 +150,36 @@ export default { ...@@ -77,9 +150,36 @@ 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) { remove(index, row) {
// if (row.add == 0) { // if (row.add == 0) {
// //新增的删除,直接删 // //新增的删除,直接删
// this.checkList.splice(index, 1); // this.checkList.splice(index, 1);
......
...@@ -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,
...@@ -107,10 +108,16 @@ export default { ...@@ -107,10 +108,16 @@ export default {
}, },
listSlecet() { listSlecet() {
let data = { let data = {
conditions: [] 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.model8 = this.cityList[0].id;
this.nodeInfo.codeRuleId = this.cityList[0].id;
this.loadTree(this.nodeInfo.codeRuleId);
}); });
}, },
// chnangeClick(val){ // chnangeClick(val){
...@@ -180,10 +187,14 @@ export default { ...@@ -180,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,
...@@ -205,6 +216,11 @@ export default { ...@@ -205,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) {
......
<template> <template>
<div class="master-data"> <div class="master-data">
<DataGrid <DataGrid
:columns="columns" :columns="cols"
ref="grid" ref="grid"
:conditions="easySearch" :conditions="easySearch"
:action="action" :action="action"
...@@ -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
); );
} }
}, },
...@@ -120,7 +122,7 @@ export default { ...@@ -120,7 +122,7 @@ export default {
render: (h, params) => { render: (h, params) => {
return h("state", { return h("state", {
props: { props: {
code: "materail.category.status", code: "material.main.status",
type: "text", type: "text",
value: params.row.status + "" value: params.row.status + ""
} }
...@@ -137,11 +139,25 @@ export default { ...@@ -137,11 +139,25 @@ export default {
title: "描述", title: "描述",
align: "left" align: "left"
}, },
{
key: "creationTime",
title: "创建时间",
hide: true,
align: "left",
type: "date"
},
{
key: "creatorUserId",
title: "创建人",
hide: true,
align: "left",
type: "user"
},
{ {
title: "操作", title: "操作",
key: "action", key: "action",
width: 260, width: 150,
align: "left", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", { class: "action" }, [
h( h(
...@@ -171,7 +187,8 @@ export default { ...@@ -171,7 +187,8 @@ export default {
]); ]);
} }
} }
] ], //基础咧
cols: [] //
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
...@@ -179,6 +196,11 @@ export default { ...@@ -179,6 +196,11 @@ export default {
}, },
created() { created() {
this.tableHeight = window.innerHeight - 220; this.tableHeight = window.innerHeight - 220;
if (this.nodeInfo.rootCategoryId == 0) {
this.cols = this.columns;
} else {
this.initCols();
}
}, },
mounted() { mounted() {
window.onresize = () => { window.onresize = () => {
...@@ -192,6 +214,7 @@ export default { ...@@ -192,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() {
...@@ -205,56 +228,97 @@ export default { ...@@ -205,56 +228,97 @@ export default {
search() { search() {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
initCols() {
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.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;
}
if(u.unitName){
var units= this.$store.getters.dictionaryByKey("material.main.unitName");
let item=units.filter(p=>{
return p.code==u.unitName;
})
console.log(units,item)
col.title+="("+item[0].name+")";
}
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]);
}
});
},
add() { add() {
this.curId = 0; if (this.nodeInfo.categoryId) {
this.title = "新增"; if (this.nodeInfo.addChange == true) {
this.detail = () => import("./add"); this.fullscreen = false;
this.modal = true; this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
} else {
this.$Message.error("请在设置的分类层级数下添加物料");
}
} else {
this.$Message.error("请先选择分类");
}
}, },
edit(row) { edit(row) {
console.log(row); this.fullscreen = false;
this.curId = row.id; this.curId = row.id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./edit"); this.detail = () => import("./edit");
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("删除成功");
} }
}); });
// this.$Modal.confirm({
// title: "删除",
// content: "<p>您确定要删除吗?</p>",
// onOk: () => {
// alert(1);
// Api.delete({ id: this.eid }).then(r => {
// if (r.success) {
// this.$emit("on-ok");
// this.$Message.success("删除成功");
// }
// });
// },
// onCancel: () => {
// this.$Message.success("取消删除");
// }
// });
}, },
details(id) { details(row) {
this.$router.push({ this.fullscreen = true;
path: "/materiel/masterData/details", this.curId = row.id;
query: { this.rootCategoryId = row.rootCategoryId;
id: id this.title = "详情";
} this.detail = () => import("./details");
}); this.rowsTable = [];
this.modal = true;
}, },
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 = [];
...@@ -273,6 +337,10 @@ export default { ...@@ -273,6 +337,10 @@ export default {
watch: { watch: {
nodeInfo: { nodeInfo: {
handler(newName, oldName) { handler(newName, oldName) {
console.log("ovo", newName, oldName);
if (newName.rootCategoryId) {
this.initCols();
}
if (newName.categoryId) { if (newName.categoryId) {
this.easySearch.categoryId.value = newName.ids; this.easySearch.categoryId.value = newName.ids;
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
......
...@@ -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,17 +249,25 @@ export default { ...@@ -171,17 +249,25 @@ 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); if (this.entity.code) {
codeList.push(this.entity.code); codeList.push(this.entity.code);
} else {
codeList.push(this.eid);
}
idList.push(this.eid);
} else { } else {
this.rowsTable.forEach(e => { this.rowsTable.forEach(e => {
idList.push(e.id); idList.push(e.id);
codeList.push(e.code); if (e.code) {
codeList.push(e.code);
} else {
codeList.push(e.id);
}
}); });
} }
this.dataListRetrunNew.idList = idList; this.dataListRetrunNew.idList = idList;
...@@ -193,8 +279,6 @@ export default { ...@@ -193,8 +279,6 @@ export default {
this.ModalInfoStaut = "orderSendReview"; this.ModalInfoStaut = "orderSendReview";
this.metCodesStrTxt = "确定物料 " + metCodesStr + "?"; this.metCodesStrTxt = "确定物料 " + metCodesStr + "?";
this.ModalInfo = true; this.ModalInfo = true;
alert(this.dataListRetrunNew.idList);
alert(this.dataListRetrunNew.codeList);
}, },
modalInfoOk() { modalInfoOk() {
let ues = this.$refs.userProcess; let ues = this.$refs.userProcess;
......
...@@ -266,9 +266,17 @@ export default { ...@@ -266,9 +266,17 @@ export default {
}, },
columns12: [ columns12: [
{ title: "序号", type: "index", width: "70", align: "center" }, { title: "序号", type: "index", width: "70", align: "center" },
{ title: "参数名称", key: "check_params" }, { title: "参数名称", key: "check_params" , tooltip: true },
{ title: "检验类型", key: "inspectType" }, { title: "检验类型", key: "inspect_type" ,render(h,params) {
{ title: "汇报类型", key: "fillintype" },
return h("state",{
props:{
code:"QC.checktype",
value:params.row.inspect_type
}
})
},},
{ title: "汇报类型", key: "fillintype_str",width:100 },
{ title: "标准指标", key: "standard" }, { title: "标准指标", key: "standard" },
{ title: "生产要求", key: "production_requirement", tooltip: true }, { title: "生产要求", key: "production_requirement", tooltip: true },
{ title: "检测内容", key: "check_content", tooltip: true }, { title: "检测内容", key: "check_content", tooltip: true },
...@@ -344,11 +352,13 @@ export default { ...@@ -344,11 +352,13 @@ export default {
{ {
title: "是否拍照", title: "是否拍照",
key: "isPhotograph", key: "isPhotograph",
width:100,
slot: "isPhotograph" slot: "isPhotograph"
}, },
{ {
title: "模板", title: "模板",
key: "qualityTemplate", key: "qualityTemplate",
width:80,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div",
...@@ -637,7 +647,6 @@ if (checktypes.indexOf("1") > -1) { ...@@ -637,7 +647,6 @@ if (checktypes.indexOf("1") > -1) {
this.$refs.usercard.loadentry(this.entryModel, fillModel, recordList); this.$refs.usercard.loadentry(this.entryModel, fillModel, recordList);
}, },
selfchecklistcheck(index, e) { selfchecklistcheck(index, e) {
alert(e);
this.recorddata[index].selfchecklist.checkstatus = e; this.recorddata[index].selfchecklist.checkstatus = e;
this.recorddata[index].selfchecklist.fill_in_content = e ? "1" : "0"; this.recorddata[index].selfchecklist.fill_in_content = e ? "1" : "0";
}, },
......
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