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

库房入库,项目管理

parent e09caa9f
<template> <template>
<Row> <Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title+':'" :prop="li.name" v-if="li.field!='name'&&li.field!='code'"> <FormItem
<div>{{li.newConten}}</div> :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> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -12,16 +54,22 @@ export default { ...@@ -12,16 +54,22 @@ export default {
data() { data() {
return { return {
fileds: [], //扩展属性 fileds: [], //扩展属性
show: false,
entity: { entity: {
// json: {}, // json: {},
}, },
}; };
}, },
props: ["materialId", "forItem"], props: ["materialId", "forItem", "input"],
mounted() { mounted() {
if (this.materialId) { if (this.materialId) {
this.get(); this.get();
} }
if (this.input) {
this.show = true;
} else {
this.show = false;
}
}, },
watch: { watch: {
materialId(v) { materialId(v) {
...@@ -38,7 +86,6 @@ export default { ...@@ -38,7 +86,6 @@ export default {
}, },
methods: { methods: {
get() { get() {
this.$api this.$api
.get( .get(
`${material}/custompropertydefinition/getmaterialdefinitionproperty`, `${material}/custompropertydefinition/getmaterialdefinitionproperty`,
...@@ -56,10 +103,10 @@ export default { ...@@ -56,10 +103,10 @@ export default {
return item.fieldType; return item.fieldType;
}); });
this.fileds.map((u) => { this.fileds.map((u) => {
// let v = ""; let v = "";
// if (u.dataType == 1 || u.dataType == 2) { if (u.dataType == 1 || u.dataType == 2) {
// v = 0; v = 0;
// } }
// console.log(u); // console.log(u);
// this.$set(this.entity.customProperties,u.filed,v) // this.$set(this.entity.customProperties,u.filed,v)
// console.log(this.forItem); // console.log(this.forItem);
...@@ -72,7 +119,7 @@ export default { ...@@ -72,7 +119,7 @@ export default {
} }
} }
// this.$emit("onValue", u.filed, v, this.forItem[key]); // this.$emit("onValue", u.filed, v, this.forItem[key]);
// this.$set(this.entity, u.filed, v); // this.$set(this.entity, u.filed, v);
}); });
} }
}); });
......
...@@ -1799,5 +1799,27 @@ export default { ...@@ -1799,5 +1799,27 @@ export default {
deleterUserId:'删除人', deleterUserId:'删除人',
dictionaryCode:'', dictionaryCode:'',
codeRuleId:'', codeRuleId:'',
} },
project_main:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'备注',
state:'状态',
type:'分类',
picture:'图片',
attachment:'附件',
phase:'阶段',
startDate:'开始日期',
endDate:'结束日期',
businessUnits:'业务单位',
}
} }
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<Form ref="form" :model="entity" :rules="rules" :label-width="100"> <Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('storeTitle')+':'"> <FormItem :label="l('storeTitle') + ':'">
<div>{{rootName}}</div> <div>{{ rootName }}</div>
<!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> --> <!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('creator')+':'">{{entity.creator}}</FormItem> <FormItem :label="l('creator') + ':'">{{ entity.creator }}</FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('name')" prop="materialId"> <FormItem :label="l('name')" prop="materialId">
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
<Col :span="12"> <Col :span="12">
<FormItem :label="l('inputTotal')" prop="total"> <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> </FormItem>
</Col> </Col>
...@@ -37,15 +40,16 @@ ...@@ -37,15 +40,16 @@
<Divider orientation="left">物料属性</Divider> <Divider orientation="left">物料属性</Divider>
<Col :span="12" v-if="entity.materialId"> <Col :span="12" v-if="entity.materialId">
<FormItem label="名称:"> <FormItem label="名称:">
<span>{{entity.name}}</span> <span>{{ entity.name }}</span>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12" v-if="entity.materialId"> <Col :span="12" v-if="entity.materialId">
<FormItem label="编码:"> <FormItem label="编码:">
<span>{{entity.materialCode}}</span> <span>{{ entity.materialCode }}</span>
</FormItem> </FormItem>
</Col> </Col>
<Row> <CustomProperties :materialId="entity.materialId" :forItem="forItem" :input='true'/>
<!-- <Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name" v-if="li.field!='name'&&li.field!='code'"> <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> <Input v-if="li.dataType==0" v-model="entity.json[li.field]"></Input>
...@@ -63,7 +67,7 @@ ...@@ -63,7 +67,7 @@
:placeholder="'选择'+li.title" :placeholder="'选择'+li.title"
></DatePicker> ></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity.json[li.field]"></InputFile> <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> <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> <Input v-if="li.dataType==8" type="textarea" v-model="entity.json[li.field]"></Input>
<state <state
...@@ -74,7 +78,7 @@ ...@@ -74,7 +78,7 @@
></state> ></state>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row> -->
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
...@@ -89,6 +93,7 @@ export default { ...@@ -89,6 +93,7 @@ export default {
data() { data() {
return { return {
fileds: [], //扩展属性 fileds: [], //扩展属性
forItem: {},
entity: { entity: {
name: "", name: "",
materialId: "", materialId: "",
...@@ -162,39 +167,46 @@ export default { ...@@ -162,39 +167,46 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); 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.name = e.name;
this.entity.materialId = e.materialId; this.entity.materialId = e.materialId;
this.entity.materialCode = e.mmcode; this.entity.materialCode = e.mmcode;
this.entity.json.name = e.name; this.entity.json.name = e.name;
this.entity.json.materialCode = e.mmcode; this.entity.json.materialCode = e.mmcode;
Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then( this.forItem = v;
(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);
});
}
}
);
}, },
l(key) { l(key) {
key = "stock" + "." + key; key = "stock" + "." + key;
return this.$t(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> <template>
<div>我的地盘</div> <div>
</template> <DataGrid
\ No newline at end of file :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
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