Commit c57ca226 authored by renjintao's avatar renjintao

new

parents 29349b94 687df1cc
<template>
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title+':'" :prop="li.name" v-if="li.field!='name'&&li.field!='code'">
<div>{{li.newConten}}</div>
<FormItem
:label="li.title + ':'"
:prop="li.name"
v-if="li.field != 'name' && li.field != 'code'"
>
<div v-if="show">
<Input v-if="li.dataType == 0" v-model="li.newConten"></Input>
<InputNumber
v-if="li.dataType == 1 || li.dataType == 2"
v-model="entity.json[li.field]"
class="w100"
></InputNumber>
<Dictionary
v-if="li.dataType == 3"
v-model="li.newConten"
:code="li.note"
></Dictionary>
<Input
v-if="li.dataType == 5"
type="textarea"
v-model="li.newConten"
></Input>
<DatePicker
v-if="li.dataType == 4"
v-model="li.newConten"
type="date"
:placeholder="'选择' + li.title"
></DatePicker>
<InputFile v-if="li.dataType == 6" v-model="li.newConten"></InputFile>
<InputFile v-if="li.dataType == 7" v-model="li.newConten"></InputFile>
<Input
v-if="li.dataType == 8"
type="textarea"
v-model="li.newConten"
></Input>
<state
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</div>
<div v-else>{{ li.newConten }}</div>
</FormItem>
</Col>
</Row>
......@@ -12,16 +54,22 @@ export default {
data() {
return {
fileds: [], //扩展属性
show: false,
entity: {
// json: {},
},
};
},
props: ["materialId", "forItem"],
props: ["materialId", "forItem", "input"],
mounted() {
if (this.materialId) {
this.get();
}
if (this.input) {
this.show = true;
} else {
this.show = false;
}
},
watch: {
materialId(v) {
......@@ -38,7 +86,6 @@ export default {
},
methods: {
get() {
this.$api
.get(
`${material}/custompropertydefinition/getmaterialdefinitionproperty`,
......@@ -56,10 +103,10 @@ export default {
return item.fieldType;
});
this.fileds.map((u) => {
// let v = "";
// if (u.dataType == 1 || u.dataType == 2) {
// v = 0;
// }
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// console.log(u);
// this.$set(this.entity.customProperties,u.filed,v)
// console.log(this.forItem);
......@@ -72,7 +119,7 @@ export default {
}
}
// this.$emit("onValue", u.filed, v, this.forItem[key]);
// this.$set(this.entity, u.filed, v);
// this.$set(this.entity, u.filed, v);
});
}
});
......
......@@ -143,8 +143,10 @@
</template>
<script>
import ColumnSlot from "./treeGrid/columnSolt";
export default {
name: "DataGrid",
components: { ColumnSlot },
data() {
return {
keys: "",
......@@ -155,7 +157,7 @@ export default {
pageIndex: 1,
pageSize: 20,
sortBy: "id",
isDesc:true,
isDesc: true,
conditions: [],
},
searchConditions: this.search,
......@@ -294,15 +296,16 @@ export default {
default: "",
},
},
provide() {
return {
tableRoot: this.slots,
};
},
created() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
this.columnsCur = this.$u.clone(this.columns);
},
mounted() {
this.initColumns();
if (this.data && this.data.length > 0) {
this.list = this.data;
return;
......@@ -350,7 +353,41 @@ export default {
this.getRoutingHeaderData();
this.getAllUser(); //获取所有用户
},
methods: {
//列初始化 slot 支持;
slots() {
return this.$scopedSlots;
},
initColumns() {
this.columns.forEach((u) => {
if (!u.hide) {
u.hide = false;
}
});
var items=this.$u.clone(this.columns);
var soct=this.$scopedSlots;
console.warn("that.$scopedSlots()",soct["action"]());
items.forEach((u) => {
if (u.slot) {
u.render = (h, params) => {
return h(
"span",
// soct[u.slot]({
// row: params.row,
// column: params.column,
// index: params.index,
// })
params.row.id
);
};
delete u.slot;
}
});
this.columnsCur = items;
console.log("cur", items,this.columnsCur);
},
//数据加载
load() {
if (this.action) {
......
......@@ -217,6 +217,7 @@ export default {
Id: this.bId,
})
.then((res) => {
console.log(res)
if (res.success) {
this.ids = res.result;
let arr = [...this.data].filter((x) =>
......
export default {
name: 'ColumnSlot',
functional: true,
inject: ['tableRoot'],
props: {
row: Object,
index: Number,
column: {
type: Object,
default: null
}
},
render: (h, ctx) => {
return h('span', ctx.injections.tableRoot()[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
}));
}
};
\ No newline at end of file
This diff is collapsed.
export default {
name: 'TableSlot',
functional: true,
inject: ['tableRoot'],
props: {
row: Object,
index: Number,
column: {
type: Object,
default: null
}
},
render: (h, ctx) => {
return h('div', ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
}));
}
};
\ No newline at end of file
......@@ -1799,5 +1799,27 @@ export default {
deleterUserId:'删除人',
dictionaryCode:'',
codeRuleId:'',
}
},
project_main:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'备注',
state:'状态',
type:'分类',
picture:'图片',
attachment:'附件',
phase:'阶段',
startDate:'开始日期',
endDate:'结束日期',
businessUnits:'业务单位',
}
}
......@@ -2,13 +2,13 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row>
<Col :span="12">
<FormItem :label="l('storeTitle')+':'">
<div>{{rootName}}</div>
<FormItem :label="l('storeTitle') + ':'">
<div>{{ rootName }}</div>
<!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creator')+':'">{{entity.creator}}</FormItem>
<FormItem :label="l('creator') + ':'">{{ entity.creator }}</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('name')" prop="materialId">
......@@ -23,7 +23,10 @@
<Col :span="12">
<FormItem :label="l('inputTotal')" prop="total">
<InputNumber v-model="entity.total" style="width:280px"></InputNumber>
<InputNumber
v-model="entity.total"
style="width: 280px"
></InputNumber>
</FormItem>
</Col>
......@@ -37,15 +40,16 @@
<Divider orientation="left">物料属性</Divider>
<Col :span="12" v-if="entity.materialId">
<FormItem label="名称:">
<span>{{entity.name}}</span>
<span>{{ entity.name }}</span>
</FormItem>
</Col>
<Col :span="12" v-if="entity.materialId">
<FormItem label="编码:">
<span>{{entity.materialCode}}</span>
<span>{{ entity.materialCode }}</span>
</FormItem>
</Col>
<Row>
<CustomProperties :materialId="entity.materialId" :forItem="forItem" :input='true'/>
<!-- <Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name" v-if="li.field!='name'&&li.field!='code'">
<Input v-if="li.dataType==0" v-model="entity.json[li.field]"></Input>
......@@ -63,7 +67,7 @@
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity.json[li.field]"></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity.json[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity.json[li.field]"></Input>
<state
......@@ -74,7 +78,7 @@
></state>
</FormItem>
</Col>
</Row>
</Row> -->
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
......@@ -89,6 +93,7 @@ export default {
data() {
return {
fileds: [], //扩展属性
forItem: {},
entity: {
name: "",
materialId: "",
......@@ -162,39 +167,46 @@ export default {
handleClose() {
this.$emit("on-close");
},
change(e) {
// change(e) {
// this.entity.name = e.name;
// this.entity.materialId = e.materialId;
// this.entity.materialCode = e.mmcode;
// this.entity.json.name = e.name;
// this.entity.json.materialCode = e.mmcode;
// Api.getmaterialdefinitionproperty({ materialId: e.materialId }).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;
// return item.fieldType;
// });
// this.fileds.map((u) => {
// let v = "";
// if (u.dataType == 1 || u.dataType == 2) {
// v = 0;
// }
// // this.$set(this.entity.customProperties,u.filed,v)
// // this.entity[u.field] = "";
// this.entity.json[u.field] = "";
// this.$set(this.entity, u.filed, v);
// });
// }
// }
// );
// },
change(e, v) {
this.entity.name = e.name;
this.entity.materialId = e.materialId;
this.entity.materialCode = e.mmcode;
this.entity.json.name = e.name;
this.entity.json.materialCode = e.mmcode;
Api.getmaterialdefinitionproperty({ materialId: e.materialId }).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;
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.$set(this.entity.customProperties,u.filed,v)
// this.entity[u.field] = "";
this.entity.json[u.field] = "";
this.$set(this.entity, u.filed, v);
});
}
}
);
this.forItem = v;
},
l(key) {
key = "stock" + "." + key;
return this.$t(key);
......
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12"
><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker
type="date"
v-model="entity.creationTime"
></DatePicker> </FormItem
></Col> -->
<!-- <Col :span="12"
><FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber> </FormItem
></Col> -->
<!-- <Col :span="12"
><FormItem
:label="l('lastModificationTime')"
prop="lastModificationTime"
>
<DatePicker
type="date"
v-model="entity.lastModificationTime"
></DatePicker> </FormItem
></Col> -->
<!-- <Col :span="12"
><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber
v-model="entity.lastModifierUserId"
></InputNumber> </FormItem
></Col> -->
<!-- <Col :span="12"
><FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker
type="date"
v-model="entity.deletionTime"
></DatePicker> </FormItem
></Col> -->
<!-- <Col :span="12"
><FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber> </FormItem
></Col> -->
<Col :span="12"
><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('state')" prop="state">
<Dictionary
code="mes.project_main.State"
v-model="entity.state"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_main.Type"
v-model="entity.type"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('picture')" prop="picture">
<Input v-model="entity.picture"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="entity.attachment"> </Input> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('phase')" prop="phase">
<Dictionary
code="mes.project_main.Phase"
v-model="entity.phase"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('startDate')" prop="startDate">
<DatePicker
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('endDate')" prop="endDate">
<DatePicker
type="date"
v-model="entity.endDate"
></DatePicker> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('businessUnits')" prop="businessUnits">
<Input v-model="entity.businessUnits"> </Input> </FormItem
></Col>
<Col :span="24"
><FormItem :label="l('note')" prop="note">
<Input
v-model="entity.note"
type="textarea"
:rows="5"
></Input> </FormItem
></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
entity: {
// creationTime: null,
creatorUserId: this.$store.state.userInfo.userId,
// lastModificationTime: null,
// lastModifierUserId: null,
// isDeleted: null,
// deletionTime: null,
// deleterUserId: null,
title: "",
note: "",
state: null,
type: null,
picture: "",
attachment: "",
phase: null,
startDate: null,
endDate: null,
businessUnits: "",
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
v: Object,
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity)
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index:`${material}/projectmain/paged`,
paged(params){
return Api.post(`${material}/projectmain/paged`,params);
},
get(params){
return Api.get(`${material}/projectmain/get`,params);
},
create(params){
return Api.post(`${material}/projectmain/create`,params);
},
update(params){
return Api.post(`${material}/projectmain/update`,params);
},
delete(id) {
return Api.delete(`${material}/projectmain/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${material}/projectmain/batchdelete`,params);
}
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="24" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('state')">{{entity.state}}</Filed>
<Filed :span="12" :name="l('type')">{{entity.type}}</Filed>
<Filed :span="12" :name="l('picture')">{{entity.picture}}</Filed>
<Filed :span="12" :name="l('attachment')">{{entity.attachment}}</Filed>
<Filed :span="12" :name="l('phase')">{{entity.phase}}</Filed>
<Filed :span="12" :name="l('startDate')">{{entity.startDate}}</Filed>
<Filed :span="12" :name="l('endDate')">{{entity.endDate}}</Filed>
<Filed :span="12" :name="l('businessUnits')">{{entity.businessUnits}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('note')" prop="note"> <Input v-model="entity.note" type="textarea" :rows="5"></Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('state')" prop="state"> <Dictionary code="mes.project_main.State" v-model="entity.state"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('type')" prop="type"> <Dictionary code="mes.project_main.Type" v-model="entity.type"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('picture')" prop="picture"> <Input v-model="entity.picture"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('phase')" prop="phase"> <Dictionary code="mes.project_main.Phase" v-model="entity.phase"></Dictionary>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('startDate')" prop="startDate"> <DatePicker type="date" v-model="entity.startDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('endDate')" prop="endDate"> <DatePicker type="date" v-model="entity.endDate"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('businessUnits')" prop="businessUnits"> <Input v-model="entity.businessUnits"> </Input>
</FormItem></Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<div>我的地盘</div>
</template>
\ No newline at end of file
<div>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:type="typeInfo"
:span="6"
><template slot="easySearch"
><Form ref="formInline" :model="easySearch" inline
><FormItem prop="keys"
><Input
placeholder="请输入关键字标题"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem
><Button type="primary" @click="search">查询</Button></FormItem
>
</Form></template
>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button
:icon="iconInfo"
shape="circle"
:title="titleInfo"
@click="changeShwo"
></Button>
</template>
<template slot="card" slot-scope="{ row }">
<div class="body-card">
<Row class="title-i">
<Col :span="12">
<Ellipsis :text="row.name" :length="18" tooltip />
</Col>
<Col :span="12" class="btn-click">
<Ellipsis :text="row.code" :length="18" tooltip
/></Col>
</Row>
<Row class="row-down" :gutter="10">
<Col span="7">
<div class="img-i">
<!-- <img :src="downUrl + row.img" v-if="row.img" /> -->
<Pictrue :src="row.img" v-if="row.img" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
<Col span="17">
<div class="c">
<div>版本:{{ row.version }}</div>
<div>
状态:
<state code="word.document.status" :value="row.status" />
</div>
<!-- <div>
创建人:
<User :value="row.creatorUserId" />
</div>-->
<div class="shuo-ming">
<span>文档说明:</span>
<Ellipsis :text="row.description" :length="12" tooltip />
</div>
</div>
<div class="a-icon">
<a @click="edit(row.id)"> <Icon type="md-create" />编辑 </a
>&nbsp;
<a @click="remove(row.id)"> <Icon type="ios-trash" />删除 </a
>&nbsp;
<a @click="view(row.id)"> <Icon type="md-document" />详情 </a>
&nbsp;
<!-- <a @click="sub(row.id)" v-if="row.status == 1 && row.schemaId">
<Icon type="md-color-wand" />送审
</a> -->
</div>
</Col>
</Row>
</div>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "",
author: "henq",
description: "project_main 10/16/2020 4:01:23 PM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
type: "index",
width: 60,
align: "center",
},
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
hide: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
hide: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
hide: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
hide: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
hide: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
},
{
key: "state",
title: this.l("state"),
align: "left",
high: true,
code: "mes.project_main.State",
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
code: "mes.project_main.Type",
},
{ key: "picture", title: this.l("picture"), align: "left", high: true },
{
key: "attachment",
title: this.l("attachment"),
align: "left",
high: true,
},
{
key: "phase",
title: this.l("phase"),
align: "left",
high: true,
code: "mes.project_main.Phase",
},
{
key: "startDate",
title: this.l("startDate"),
align: "left",
high: true,
},
{ key: "endDate", title: this.l("endDate"), align: "left", high: true },
{
key: "businessUnits",
title: this.l("businessUnits"),
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
hide: false,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
},
},
],
typeInfo: "table",
iconInfo: "md-list",
titleInfo: "列表模式",
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
let vkey = "project_main" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show"><FormItem :label="$t('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.title.show"><FormItem :label="l('title')" prop="title"> <Input v-model="condition.title.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.note.show"><FormItem :label="l('note')" prop="note"> <Input v-model="condition.note.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.state.show"><FormItem :label="l('state')" prop="state"> <Dictionary code="mes.project_main.State" v-model="condition.state.value"></Dictionary>
</FormItem></Col>
<Col :span="12" :v-if="condition.type.show"><FormItem :label="l('type')" prop="type"> <Dictionary code="mes.project_main.Type" v-model="condition.type.value"></Dictionary>
</FormItem></Col>
<Col :span="12" :v-if="condition.picture.show"><FormItem :label="l('picture')" prop="picture"> <Input v-model="condition.picture.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.attachment.show"><FormItem :label="l('attachment')" prop="attachment"> <Input v-model="condition.attachment.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.phase.show"><FormItem :label="l('phase')" prop="phase"> <Dictionary code="mes.project_main.Phase" v-model="condition.phase.value"></Dictionary>
</FormItem></Col>
<Col :span="12" :v-if="condition.startDate.show"><FormItem :label="l('startDate')" prop="startDate"> <DatePicker type="daterange" v-model="condition.startDate.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.endDate.show"><FormItem :label="l('endDate')" prop="endDate"> <DatePicker type="daterange" v-model="condition.endDate.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.businessUnits.show"><FormItem :label="l('businessUnits')" prop="businessUnits"> <Input v-model="condition.businessUnits.value"> </Input>
</FormItem></Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:true},
creatorUserId:{op:"Equal",value:null,show:true},
lastModificationTime:{op:"Range",value:null,show:true},
lastModifierUserId:{op:"Equal",value:null,show:true},
deletionTime:{op:"Range",value:null,show:true},
title:{op:"Equal",value:null,show:true},
note:{op:"Equal",value:null,show:true},
state:{op:"Equal",value:null,show:true},
type:{op:"Equal",value:null,show:true},
picture:{op:"Equal",value:null,show:true},
attachment:{op:"Equal",value:null,show:true},
phase:{op:"Equal",value:null,show:true},
startDate:{op:"Range",value:null,show:true},
endDate:{op:"Range",value:null,show:true},
businessUnits:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "project_main" + "." + key;
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<!--
<Col :span="12">
......@@ -38,10 +38,11 @@
<FormItem :label="l('routingDetailName')" prop="routingDetailId">
<Select v-model="entity.routingDetailId">
<Option
v-for="(item,index) in routingDetailList"
v-for="(item, index) in routingDetailList"
:value="item.value"
:key="index"
>{{ item.label }}</Option>
>{{ item.label }}</Option
>
</Select>
</FormItem>
</Col>
......@@ -58,12 +59,31 @@
<Materiel :bomId="productBomId" v-model="entity.materialId" @on-change="change"></Materiel>
</FormItem>-->
<FormItem :label="l('nameMaterial')" prop="materialId">
<Materiel
<Select
v-model="entity.materialId"
placeholder="请选择"
style="width: 300px"
>
<Option
v-for="(item, index) in listData"
:key="index"
:value="item.value"
:label="item.label"
style="display: none"
></Option>
<Tree
key="mytree"
:data="dataTree"
ref="mytree"
:render="renderContent"
></Tree>
</Select>
<!-- <Materiel
v-model="entity.materialId"
@on-change="change"
:codeRuleType="1"
:setType="true"
></Materiel>
></Materiel> -->
</FormItem>
</Col>
<!-- <Col :span="8" v-if="false">
......@@ -73,19 +93,22 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('quantity')" prop="quantity">
<InputNumber v-model="entity.quantity" style="width:100%"></InputNumber>
<InputNumber
v-model="entity.quantity"
style="width: 100%"
></InputNumber>
</FormItem>
</Col>
<Divider orientation="left">物料属性</Divider>
<Row>
<Col :span="12" v-if="entity.materialId">
<FormItem label="名称:">
<span>{{entity.nameMaterial}}</span>
<span>{{ entity.nameMaterial }}</span>
</FormItem>
</Col>
<Col :span="12" v-if="entity.materialId">
<FormItem label="编码:">
<span>{{entity.materialNumber}}</span>
<span>{{ entity.materialNumber }}</span>
</FormItem>
</Col>
</Row>
......@@ -140,6 +163,8 @@ export default {
data() {
return {
forItem: {},
listData: [],
dataTree: [],
entity: {
routingHeaderId: null,
routingDetailId: null,
......@@ -200,11 +225,59 @@ export default {
},
mounted() {
this.loadDetails();
this.getData();
},
methods: {
// onValue(filed, v) {
// this.$set(this.entity, filed, v);
// },
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
"span",
{
style: {
cursor: "pointer",
},
on: {
click: () => {
this.handleSelect(data); //手动选择树节点
},
},
},
data.title
);
},
handleSelect(data) {
console.log(data);
let obj = {
label: data.title,
value: data.materialId,
};
this.listData = [];
this.listData.push(obj);
this.entity.materialId = this.listData[0].value;
this.entity.nameMaterial = this.listData[0].label;
this.entity.nameMaterial = data.name;
this.entity.materialId = data.materialId;
this.entity.materialNumber = data.mmcode;
this.entity.json.nameMaterial = data.name;
this.entity.json.materialNumber = data.mmcode;
Api.getMaterial({ id: data.materialId }).then((r) => {
if (r.result) {
this.forItem = r.result;
}
});
},
getData() {
Api.alltree({ id: this.productBomId }).then((r) => {
if (r.success) {
this.dataTree = r.result;
// this.$Message.success("获取物料成功");
} else {
this.$Message.error("获取物料失败");
}
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
......@@ -228,15 +301,17 @@ export default {
handleClose() {
this.$emit("on-close");
},
change(e, v) {
this.entity.nameMaterial = e.name;
this.entity.materialId = e.materialId;
this.entity.materialNumber = e.mmcode;
// change(e, v) {
// console.log(e);
// console.log(v);
// this.entity.nameMaterial = e.name;
// this.entity.materialId = e.materialId;
// this.entity.materialNumber = e.mmcode;
this.entity.json.nameMaterial = e.name;
this.entity.json.materialNumber = e.mmcode;
this.forItem = v;
},
// this.entity.json.nameMaterial = e.name;
// this.entity.json.materialNumber = e.mmcode;
// this.forItem = v;
// },
loadDetails() {
//获取工序列表
let parms = {
......
......@@ -37,4 +37,10 @@ export default {
materiallist(params){
return Api.post(`${material}/material/materiallist`,params);
},
alltree(params){
return Api.post(`${technologyUrl}productinfo/alltree`,params); //bom树
},
getMaterial(params){
return Api.get(`${material}/material/get`,params); //bom树
},
}
......@@ -20,14 +20,14 @@
<template>
<div class="flex fd test_layout">
<div>
<Menu mode="horizontal" theme="light" active-name="0">
<Menu mode="horizontal" theme="light" active-name="a0">
<div class="layout-assistant">
<MenuItem name="0" to="/test/example">基础组件</MenuItem>
<MenuItem name="1" to="/test/user">人员选择</MenuItem>
<MenuItem name="2" to="/test/com">异步组件</MenuItem>
<MenuItem name="4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="3" to="/test/view">详情拖拽排版</MenuItem>
<MenuItem name="5" to="/test/test1">colum验证</MenuItem>
<MenuItem name="a0" to="/test/example">基础组件</MenuItem>
<MenuItem name="a1" to="/test/user">人员选择</MenuItem>
<MenuItem name="a2" to="/test/com">异步组件</MenuItem>
<MenuItem name="a4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="a3" to="/test/view">详情拖拽排版</MenuItem>
<MenuItem name="a5" to="/test/test1">colum验证</MenuItem>
</div>
</Menu>
</div>
......
......@@ -13,10 +13,16 @@ export const exampleRouter = [
},
{
route: '/test/example/table',
title: 'treeGrid组件',
title: '表格',
name: 'components-table',
icon: 'md-aperture'
},
{
route: '/test/example/tree',
title: '树',
name: 'tree',
icon: 'md-aperture'
},
{
route: '/test/example/select',
title: 'select组件',
......
......@@ -21,6 +21,9 @@
</FormItem>
</Form>
</template>
<template slot-scope="{row,column,index}" slot="action">
<strong>aaaa</strong>
</template>
</DataGrid>
</div>
</template>
......@@ -62,6 +65,7 @@ export default {
easy: true,
sortable:true,
high: true,
slot:"cardNo",
tooltip: true,
},
],
......
<template>
<div class="tree">
<TreeGrid :columns="columns" :items="treeData">
<template slot-scope="{row,column,index}" slot="name">
<Icon type="md-folder" /> {{row.name}}
</template>
<template slot-scope="{row,column,index}" slot="action">
<strong>{{row.action}}</strong>
</template>
</TreeGrid>
<!-- <Input v-model="data" type="textarea" rows="20" placeholder=""></Input> -->
</div>
</template>
<script>
import Mock from "mockjs";
export default {
name: "",
data() {
return {
columns: [
{
type: "selection",
width:50,
align:"center"
},
{
key: "name",
title: "名称",
tree:true,
slot:"name"
},
{
key: "status",
title: "状态",
width: "100"
},
{
key: "action",
title: "操作",
width: "100",
sortable:true,
slot:"action"
},
],
treeData1: [],
treeData: [
{
action: "510000202006085435",
name: "书加部保处",
status: 0,
children: [
{ action: "430000200008054924", name: "越组大过越", status: 0 },
{ action: "350000200106195747", name: "反走和报山", status: 1 },
{ action: "46000019920810827X", name: "强级法量少务持", status: 1 },
{ action: "620000198005286979", name: "况题米", status: 1 },
{ action: "440000200901093872", name: "又多为", status: 0 },
],
},
{ action: "510000199304272074", name: "参什叫", status: 1 },
{ action: "710000199110144186", name: "情克应个该农", status: 1 },
{ action: "140000201204175550", name: "阶研其交式", status: 1 },
{ action: "500000198710051748", name: "议开你集", status: 1 },
],
data: "",
};
},
mounted() {
// this.init();
},
methods: {
init() {
var data = Mock.mock({
"data|5": [
{
action: "@id",
name: "@ctitle",
"status|1": [0, 1],
},
],
});
console.warn(data);
this.data = JSON.stringify(data.data);
this.treeData = data.data;
},
},
};
</script>
<style lang="less" >
</style>
\ No newline at end of file
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