Commit e4fa1ce2 authored by 佟礼's avatar 佟礼

数据填报合并

parents 24e35bbc 28524808
......@@ -429,7 +429,7 @@ export default {
let v = conditions[u].value;
let op = conditions[u].op;
if (!this.$u.isNull(v)) {
if (op == "Range") {
if (op == "Range"&&Array.isArray(v)) {
let times = [];
v.map(u => {
if (!this.$u.isNull(u)) {
......@@ -437,7 +437,7 @@ export default {
}
});
v = times.join(",");
} else if (op.indexOf("In") > -1) {
} else if (op.indexOf("In") > -1&&Array.isArray(v)) {
v = v.join(",");
}
if (!this.$u.isNull(v)) {
......@@ -544,6 +544,14 @@ export default {
},
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>
<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>
</div>
</template>
......
......@@ -30,29 +30,36 @@
</Col>
<Col :span="24">
<h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList" height="300">
<Table border :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
v-if="row.fieldType==3"
v-model="row.title"
placeholder="请输入"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div>
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<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 slot-scope="{ row, index }" slot="dataType">
<state
v-if="row.fieldType==1"
code="materail.category.dataType"
:value="row.dataType"
type="text"
></state>
<Dictionary
v-else
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
......@@ -61,20 +68,17 @@
:key="row.dataType"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<!-- <state
v-if="row.fieldType==1"
code="materail.main.company"
:value="row.company"
type="text"
></state> -->
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-model="row.company"
code="materail.main.company"
v-model="row.unitName"
code="material.main.unitName"
type="select"
:value="row.company"
:key="row.company"
placeholder="请选择单位"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
......@@ -118,6 +122,7 @@ export default {
codeRuleId: this.nodeInfo.codeRuleId
},
disabled: false,
codeList: [],
columns: [
{
title: "序号",
......@@ -128,43 +133,46 @@ export default {
{
title: "属性名称",
key: "title",
align: "center",
slot: "title"
},
{
title: "备注",
key: "note",
title: "属性类型",
key: "dataType",
align: "center",
slot: "note"
slot: "dataType",
width:200
},
{
title: "属性类型",
key: "dataType",
title: "设置",
key: "note",
align: "center",
slot: "dataType"
slot: "note",
},
{
title: "单位",
key: "company",
key: "unitName",
align: "center",
slot: "company"
slot: "unitName",
width: "150"
},
{
title: "是否必填",
title: "必填",
key: "required",
align: "center",
slot: "required"
slot: "required",
width: 80
},
{
title: "是否唯一属性",
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique"
slot: "isUnique",
width: 80
},
{
width:80,
title: "操作",
slot: "action",
width: 100,
align: "center"
}
],
......@@ -177,7 +185,7 @@ export default {
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
created() {
this.tableData();
},
methods: {
......@@ -203,11 +211,17 @@ export default {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function(item) {
item.mid = item.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) {
if (row.add == 0) {
......@@ -224,10 +238,18 @@ export default {
this.$set(this.checkList, index, row);
},
addNew() {
let maxId = 0;
this.checkList.map(u => {
if (u.mid > maxId) {
maxId = u.mid;
}
});
let obj = {
mid: maxId + 1,
field: "c" + maxId,
title: "",
note: "",
dataType: "",
dataType: 0,
required: false,
isunique: false,
fieldType: 3,
......@@ -235,7 +257,7 @@ export default {
action: 1,
add: 0 //新增标识
};
this.checkList.push(obj);
this.checkList.unshift(obj);
},
handleSubmit() {
this.$refs.form.validate(v => {
......
......@@ -26,5 +26,7 @@ export default {
delete(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>
<div>
<div class="p10">
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12">
......@@ -29,28 +29,37 @@
</FormItem>
</Col>
<Col :span="24">
<h4>属性配置</h4>
</Col>
<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">
<h4>扩展属性</h4>
<Table border :columns="columns" :data="checkList">
<template slot-scope="{ row, index }" slot="title">
<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 slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div>
<Input v-model="row.note" placeholder="请输入" @on-blur="setRow(row,index)" v-else />
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<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 slot-scope="{ row, index }" slot="dataType">
<state
v-if="row.fieldType==1"
code="materail.category.dataType"
:value="row.dataType"
type="text"
></state>
<Dictionary
v-else
@on-change="setRow(row,index)"
v-model="row.dataType"
code="materail.category.dataType"
......@@ -59,29 +68,37 @@
:key="row.dataType"
></Dictionary>
</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="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
placeholder="请选择单位"
:value="row.unitName"
:key="row.unitName"
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
</template>
<template
slot-scope="{ row, index }"
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>
</template>
</Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
</Col>
<Col :span="24" style="margin-bottom:20px;">
<Button type="primary" long @click="addNew" class="mt10">添加</Button>
</Col>
<Col :span="24" style="text-align: right;">
<Col :span="24" class="tr mt10">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
......@@ -114,43 +131,44 @@ export default {
{
title: "属性名称",
key: "title",
align: "center",
slot: "title"
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 150
},
{
title: "备注",
key: "note",
align: "center",
slot: "note"
},
{
title: "属性类型",
key: "dataType",
title: "单位",
key: "unitName",
align: "center",
slot: "dataType"
},
// {
// title: "是否显示",
// key: "result",
// align: "center",
// slot: "result"
// },
slot: "unitName"
},
{
title: "是否必填",
title: "必填",
key: "required",
align: "center",
slot: "required"
slot: "required",
width: 80
},
{
title: "是否唯一属性",
key: "isunique",
title: "唯一",
key: "isUnique",
align: "center",
slot: "isunique"
slot: "isUnique",
width: 80
},
{
title: "操作",
slot: "action",
width: 100,
width: 80,
align: "center"
}
],
......@@ -184,12 +202,24 @@ export default {
fieldValue: this.nodeInfo.id
}
];
Api.listTable({ conditions: conditions }).then(r => {
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) {
console.log(r);
r.result.map(u => {
u.mid = u.id;
});
this.checkList = r.result;
}
});
Api.getChildren({ id: 582 }).then(r => {
if (r.result) {
this.codeList = r.result;
}
});
},
remove(index, row) {
if (row.add == 0) {
......@@ -205,20 +235,26 @@ export default {
this.$set(this.checkList, index, row);
},
addNew() {
let arr = this.$u.clone(this.checkList);
let maxId = 0;
this.checkList.map(u => {
if (u.mid > maxId) {
maxId = u.mid;
}
});
let obj = {
mid: maxId + 1,
field: "c" + maxId,
title: "",
note: "",
dataType: "",
dataType: "0",
required: false,
isunique: false,
fieldType: 3,
categoryId: 0,
action: 1,
add: 0
add: 0 //新增标识
};
arr.push(obj);
this.checkList = arr;
this.checkList.unshift(obj);
},
handleSubmit() {
this.$refs.form.validate(v => {
......
......@@ -68,7 +68,7 @@
<MasterData ref="dataTable" @on-edit="editRow" :root="root" @on-ok="ok" />
</Content>
</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
:is="detail"
:eid="curId"
......@@ -133,10 +133,16 @@ export default {
},
listSlecet() {
let data = {
conditions: []
conditions: [],
sortBy: "id",
isDesc: false
};
Api.pagedSlecet(data).then(r => {
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 {
// }
},
loadTree(id) {
let conditions = [
let data = {
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(
r.result,
0,
......
......@@ -111,7 +111,7 @@ export default {
},
methods: {
search() {
alert(JSON.stringify(this.easySearch));
// alert(JSON.stringify(this.easySearch));
console.log(this.easySearch);
this.$refs.grid.reload(this.easySearch);
},
......@@ -121,7 +121,6 @@ export default {
remove(id) {
Api.delete(id).then(r => {
if (r.success) {
this.$emit("on-ok");
this.$refs.grid.reload(this.easySearch);
this.$Message.success("删除成功");
}
......
......@@ -7,11 +7,11 @@
<Input v-model="upName" placeholder="请输入" disabled></Input>
</FormItem>
</Col>
<Col :span="12">
<!-- <Col :span="12">
<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>
......
......@@ -2,27 +2,27 @@
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<!-- <Col :span="12">
<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>
</FormItem>
</Col>
<Col :span="12">
<!-- <Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择">
<Dictionary
code="materail.category.status"
code="material.main.status"
v-model="entity.status"
type="select"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
</Col>-->
<Col :span="12">
<FormItem label="版本" prop="version">
<Input v-model="entity.version" placeholder="请输入"></Input>
......@@ -33,6 +33,37 @@
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem>
</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;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -53,6 +84,7 @@ export default {
entity: {
code: 0,
status: 0,
codeRuleId: this.nodeInfo.codeRuleId,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
......@@ -61,40 +93,51 @@ export default {
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
},
fileds: [] //扩展属性
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
// this.tableData();
created() {
this.initFiled();
},
methods: {
// tableData() {
// let conditions = [
// {
// conditionalType: "In",
// fieldName: "fieldType",
// fieldValue: "1,2"
// },
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: "0"
// }
// ];
initFiled() {
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.rootCategoryId
}
];
// Api.listTable({ conditions: conditions }).then(r => {
// if (r.result) {
// var arr = r.result;
// this.checkList = arr.filter(function(item) {
// delete item["id"];
// return item;
// });
// }
// });
// },
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);
});
}
});
},
remove(index, row) {
if (row.add == 0) {
//新增的删除,直接删
......
......@@ -11,14 +11,17 @@ export default {
list(params){
return Api.post(`${systemUrl}/category/list`,params);
},
listTable(params){
return Api.post(`${systemUrl}/custompropertydefinition/list`,params);
},
get(params){
return Api.get(`${systemUrl}/material/get`,params);
},
create(params){
return Api.post(`${systemUrl}/material/create`,params);
return Api.post(`${systemUrl}/material/createnew`,params);
},
update(params){
return Api.post(`${systemUrl}/material/update`,params);
return Api.post(`${systemUrl}/material/updatenew`,params);
},
delete(id) {
return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}});
......
<template>
<div class="maseter">
<div class="come-back" @click="back">
<Icon type="ios-undo-outline" />返回
</div>
<Layout class="data-details">
<Sider hide-trigger class="left-detail" width="300">
<h4 class="bt">标题</h4>
......@@ -25,35 +22,23 @@
<Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" />
</Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row>
<!-- <Divider />
<div class="title-h4">engineering</div>
<Divider orientation="left">扩展属性</Divider>
<Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
<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>
<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 v-show="showTable">
<DataGrid :columns="columns" ref="grid" :action="action" :tool="false" :height="750"></DataGrid>
<!-- <Table border :columns="columns" :data="data1" :height="800"></Table> -->
</div>
</Content>
</Layout>
......@@ -62,21 +47,23 @@
<script>
import Api from "./api";
export default {
props: ["eid", "rootCategoryId"],
data() {
return {
data1: [],
action: Api.lists,
isactive: null,
showFrom: false,
isactive: 0,
showFrom: true,
showTable: false,
rowId: "",
fileds: [],
rowId: this.eid,
entity: {},
easySearch: {
keys: { op: "title", value: "" },
tableTitle: { op: "Equal", value: "material" },
tId: {
op: "Equal",
value: this.$route.query.id
value: this.eid
}
},
listData: [
......@@ -101,13 +88,46 @@ export default {
]
};
},
created() {
this.rowId = this.$route.query.id;
mounted() {
this.load(this.eid);
this.initFiled();
},
methods: {
back() {
this.$router.push({
path: "/materiel/masterData"
load(v) {
Api.get({ id: v }).then(r => {
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) {
......@@ -115,35 +135,11 @@ export default {
if (li.lable == "属性") {
this.showFrom = true;
this.showTable = false;
Api.get({ id: this.rowId }).then(r => {
if (r.result) {
this.entity = r.result;
}
});
this.load(this.eid);
} else {
this.showFrom = false;
this.showTable = true;
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) {
......@@ -154,20 +150,6 @@ export default {
};
</script>
<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 {
background-color: #f5f7f9 !important;
}
......@@ -179,7 +161,7 @@ export default {
background: rgba(255, 255, 255, 1);
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 86vh;
height: 90vh;
overflow: auto;
.bt {
height: 50px;
......@@ -214,7 +196,7 @@ export default {
padding: 10px 15px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 86vh;
height: 90vh;
overflow: auto;
.btn {
text-align: right;
......
......@@ -13,9 +13,14 @@
</FormItem>
</Col>
<Col :span="12">
<FormItem label="状态" prop="status" placeholder="请选择">
<FormItem
label="状态"
prop="status"
placeholder="请选择"
v-if="entity.status==3||entity.status==2"
>
<Dictionary
code="materail.category.status"
code="material.main.status"
v-model="entity.status"
type="select"
:value="entity.status"
......@@ -33,6 +38,36 @@
<Input v-model="entity.description" type="textarea" placeholder="请输入..."></Input>
</FormItem>
</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;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -46,7 +81,7 @@
<script>
import Api from "./api";
export default {
props: ["nodeInfo",'eid'],
props: ["nodeInfo", "eid"],
data() {
return {
arr: [],
......@@ -57,6 +92,8 @@ export default {
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id
},
fileds: [],
checkList: [],
disabled: false,
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
......@@ -66,10 +103,46 @@ export default {
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.initFiled();
},
mounted() {
this.get();
},
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() {
Api.get({ id: this.eid }).then(r => {
if (r.result) {
......@@ -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) {
// if (row.add == 0) {
// //新增的删除,直接删
// this.checkList.splice(index, 1);
......
......@@ -75,7 +75,8 @@ export default {
nodeInfo: {
categoryId: 0,
rootCategoryId: 0,
ids: []
ids: [],
addChange: true
},
downName: "请选择类型",
modal: false,
......@@ -107,10 +108,16 @@ export default {
},
listSlecet() {
let data = {
conditions: []
conditions: [],
sortBy: "id",
isDesc: false
};
Api.pagedSlecet(data).then(r => {
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){
......@@ -180,10 +187,14 @@ export default {
}
},
loadTree(id) {
let conditions = [
let data = {
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(
r.result,
0,
......@@ -205,6 +216,11 @@ export default {
}
},
change(v, b) {
if (b.level < b.ruleLevel && b.children.length > 0) {
this.nodeInfo.addChange = false;
} else {
this.nodeInfo.addChange = true;
}
let ids = [];
ids.push(b.value);
if (b.children) {
......
<template>
<div class="master-data">
<DataGrid
:columns="columns"
:columns="cols"
ref="grid"
:conditions="easySearch"
:action="action"
......@@ -44,6 +44,7 @@
<component
:is="detail"
:eid="curId"
:rootCategoryId="rootCategoryId"
:rowsTable="rowsTable"
:nodeInfo="nodeInfo"
@on-close="cancel"
......@@ -70,6 +71,7 @@ export default {
modal: false,
title: "新增",
curId: 0,
rootCategoryId: 0,
selectRows: [],
rowsTable: [],
fullscreen: false,
......@@ -101,10 +103,10 @@ export default {
{
props: {},
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 {
render: (h, params) => {
return h("state", {
props: {
code: "materail.category.status",
code: "material.main.status",
type: "text",
value: params.row.status + ""
}
......@@ -137,11 +139,25 @@ export default {
title: "描述",
align: "left"
},
{
key: "creationTime",
title: "创建时间",
hide: true,
align: "left",
type: "date"
},
{
key: "creatorUserId",
title: "创建人",
hide: true,
align: "left",
type: "user"
},
{
title: "操作",
key: "action",
width: 260,
align: "left",
width: 150,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
......@@ -171,7 +187,8 @@ export default {
]);
}
}
]
], //基础咧
cols: [] //
};
},
async fetch({ store, params }) {
......@@ -179,6 +196,11 @@ export default {
},
created() {
this.tableHeight = window.innerHeight - 220;
if (this.nodeInfo.rootCategoryId == 0) {
this.cols = this.columns;
} else {
this.initCols();
}
},
mounted() {
window.onresize = () => {
......@@ -192,6 +214,7 @@ export default {
methods: {
onSelect(a, b) {
//批量选择
this.rootCategoryId = a[0].rootCategoryId;
this.selectRows = a;
},
modalSchedule() {
......@@ -205,56 +228,97 @@ export default {
search() {
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() {
if (this.nodeInfo.categoryId) {
if (this.nodeInfo.addChange == true) {
this.fullscreen = false;
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
} else {
this.$Message.error("请在设置的分类层级数下添加物料");
}
} else {
this.$Message.error("请先选择分类");
}
},
edit(row) {
console.log(row);
this.fullscreen = false;
this.curId = row.id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
alert(id);
Api.delete(id).then(r => {
if (r.success) {
this.$emit("on-ok");
this.$refs.grid.reload(this.easySearch);
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) {
this.$router.push({
path: "/materiel/masterData/details",
query: {
id: id
}
});
details(row) {
this.fullscreen = true;
this.curId = row.id;
this.rootCategoryId = row.rootCategoryId;
this.title = "详情";
this.detail = () => import("./details");
this.rowsTable = [];
this.modal = true;
},
send(row) {
this.fullscreen = true;
this.curId = row.id;
this.rootCategoryId = row.rootCategoryId;
this.title = "物料送审";
this.detail = () => import("./submit");
this.rowsTable = [];
......@@ -273,6 +337,10 @@ export default {
watch: {
nodeInfo: {
handler(newName, oldName) {
console.log("ovo", newName, oldName);
if (newName.rootCategoryId) {
this.initCols();
}
if (newName.categoryId) {
this.easySearch.categoryId.value = newName.ids;
this.$refs.grid.reload(this.easySearch);
......
......@@ -3,20 +3,29 @@
<div class="body-procee">
<div class="new-detail" v-if="osrOneList1">
<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="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" />
</Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed>
</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>
<Table
:loading="loading"
border
:columns="columns"
:columns="cols"
:data="dataList"
class="tableCommon"
v-if="osrOneList2"
......@@ -53,7 +62,7 @@ export default {
components: {
Process
},
props: ["eid", "rowsTable"],
props: ["eid", "rootCategoryId", "rowsTable"],
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
......@@ -81,6 +90,7 @@ export default {
codeList: [], //合格证编号List
operatorIdList: [] //操作员id
}, //确定后返回数据
cols: [],
columns: [
{
key: "code",
......@@ -141,6 +151,7 @@ export default {
} else {
this.osrOneList1 = false;
this.osrOneList2 = true;
this.getTable();
this.dataList = this.rowsTable;
}
},
......@@ -158,10 +169,77 @@ export default {
Api.get({ id: v }).then(r => {
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);
});
}
});
}
});
},
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() {
let ues = this.$refs.userProcess;
this.dataListRetrunNew.operatorIdList = ues.immutData;
......@@ -171,17 +249,25 @@ export default {
},
upSave() {
this.dataListRetrunNew.idList = [];
this.dataListRetrunNew.codeList = [];
let codeList = [];
let idList = [];
idList.push(this.rowId);
codeList.push(this.entity.code);
if (this.eid !== 0) {
idList.push(this.rowId);
if (this.entity.code) {
codeList.push(this.entity.code);
} else {
codeList.push(this.eid);
}
idList.push(this.eid);
} else {
this.rowsTable.forEach(e => {
idList.push(e.id);
if (e.code) {
codeList.push(e.code);
} else {
codeList.push(e.id);
}
});
}
this.dataListRetrunNew.idList = idList;
......@@ -193,8 +279,6 @@ export default {
this.ModalInfoStaut = "orderSendReview";
this.metCodesStrTxt = "确定物料 " + metCodesStr + "?";
this.ModalInfo = true;
alert(this.dataListRetrunNew.idList);
alert(this.dataListRetrunNew.codeList);
},
modalInfoOk() {
let ues = this.$refs.userProcess;
......
......@@ -266,9 +266,17 @@ export default {
},
columns12: [
{ title: "序号", type: "index", width: "70", align: "center" },
{ title: "参数名称", key: "check_params" },
{ title: "检验类型", key: "inspectType" },
{ title: "汇报类型", key: "fillintype" },
{ title: "参数名称", key: "check_params" , tooltip: true },
{ title: "检验类型", key: "inspect_type" ,render(h,params) {
return h("state",{
props:{
code:"QC.checktype",
value:params.row.inspect_type
}
})
},},
{ title: "汇报类型", key: "fillintype_str",width:100 },
{ title: "标准指标", key: "standard" },
{ title: "生产要求", key: "production_requirement", tooltip: true },
{ title: "检测内容", key: "check_content", tooltip: true },
......@@ -344,11 +352,13 @@ export default {
{
title: "是否拍照",
key: "isPhotograph",
width:100,
slot: "isPhotograph"
},
{
title: "模板",
key: "qualityTemplate",
width:80,
render: (h, params) => {
return h(
"div",
......@@ -637,7 +647,6 @@ if (checktypes.indexOf("1") > -1) {
this.$refs.usercard.loadentry(this.entryModel, fillModel, recordList);
},
selfchecklistcheck(index, e) {
alert(e);
this.recorddata[index].selfchecklist.checkstatus = e;
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