Commit 40bf3fd1 authored by renjintao's avatar renjintao

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

parents 9e23b3be e2e31c93
...@@ -45,7 +45,10 @@ div::-webkit-scrollbar-thumb:hover { ...@@ -45,7 +45,10 @@ div::-webkit-scrollbar-thumb:hover {
div::-webkit-scrollbar-corner { div::-webkit-scrollbar-corner {
background: @scrollbar-corner-bg-color; background: @scrollbar-corner-bg-color;
} }
.ivu-date-picker{
display: block;
width: 100%;
}
/*flex*/ /*flex*/
.flex { .flex {
display: flex; display: flex;
......
<template> <template>
<div class="time-view" v-if="startDate && endDate"> <DatePicker
v-if="edit"
:open="open"
:value="value3"
type="datetimerange"
@on-change="handleChange"
@on-clear="handleClear"
@on-ok="handleClear"
confirm
>
<div
class="time-range ivu-input"
href="javascript:void(0)"
@click="handleClick"
>
<Icon type="ios-calendar-outline"></Icon>
<div class="time-view" v-if="startDate && endDate">
<span>{{ startDate }}</span>
<span class="jian-tou">{{ jg }} {{ unit }}</span>
<span>{{ endDate }}</span>
</div>
<span v-else v-text="placeholder"> </span>
</div>
</DatePicker>
<div class="time-view" v-else-if="!edit && startDate && endDate">
<span>{{ startDate }}</span> <span>{{ startDate }}</span>
<span class="jian-tou">{{ jg }} {{ unit }}</span> <span class="jian-tou">{{ jg }} {{ unit }}</span>
<span>{{ endDate }}</span> <span>{{ endDate }}</span>
</div> </div>
</template> </template>
...@@ -9,12 +33,14 @@ ...@@ -9,12 +33,14 @@
import dayjs from "dayjs"; import dayjs from "dayjs";
export default { export default {
name: "", name: "",
model: {
prop: "value",
event: "on-change",
},
data() { data() {
return { return {
startDate: null, value3: [this.value[this.start],this.value[this.endDate]],
endDate: null, open: false,
unit: "天",
jg: 0,
}; };
}, },
props: { props: {
...@@ -23,6 +49,14 @@ export default { ...@@ -23,6 +49,14 @@ export default {
type: String, type: String,
default: "startDate", default: "startDate",
}, },
unit: {
type: String,
default: "天",
},
placeholder: {
type: String,
default: "请选择时间范围",
},
end: { end: {
type: String, type: String,
default: "endDate", default: "endDate",
...@@ -35,51 +69,77 @@ export default { ...@@ -35,51 +69,77 @@ export default {
type: [String, Object], type: [String, Object],
default: "", default: "",
}, },
edit: {
type: Boolean,
default: false,
},
work: { work: {
type: [String, Number], //传入的work为0,转换为小时,1为天,2为周,3为月 type: [String, Number], //传入的work为0,转换为小时,1为天,2为周,3为月
default: 8, default: 8,
}, },
}, },
created() {
mounted() {
this.init();
}, },
methods: { methods: {
init(v) { handleClick() {
if (v) { this.open = !this.open;
var start = dayjs(v[this.start]); },
var end = dayjs(v[this.end]); handleChange(date, t) {
this.startDate=start.format("YYYY-MM-DD"); if (date.length == 2) {
this.endDate=end.format("YYYY-MM-DD"); this.value3 = date;
this.jg=end.diff(start,'day'); this.value[this.start] = date[0];
this.value[this.end] = dayjs(date[1]).format("YYYY-MM-DD 23:59:59");
this.$emit("on-change", this.value);
} }
this.open = false;
},
handleClear() {
this.open = false;
}, },
}, },
watch: { computed: {
value: { startDate() {
handler: function (n, v) { if (this.value && this.value[this.start]) {
this.init(n); var start = dayjs(this.value[this.start]);
}, return start.format("YYYY-MM-DD");
deep: true, }
}, },
endDate() {
if (this.value&&this.value[this.end]) {
var end = dayjs(this.value[this.end]);
return end.format("YYYY-MM-DD");
}
},
jg(){
if (this.value&&this.value[this.start] && this.value[this.end]) {
var start = dayjs(this.value[this.start]);
var end = dayjs(this.value[this.end]);
return end.diff(start,'day')+1;
}
}
},
watch: {
value(v){
this.value=[v[this.start],v[this.end]]
}
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
.time-view { .time-view {
display: inline-block; display: inline-block;
span{size: 12px}
.jian-tou { span.jian-tou {
min-width: 55px; min-width:60px;
text-align: center; text-align: center;
padding: 0 5px 2px 5px; display: inline-block;
background-image: url("../../assets/imgicon/range.png"); background-image: url("../../assets/imgicon/range.png");
background-size: 100%; background-size: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: bottom right; background-position: 100% 80%;
// border-bottom: #eee 2px solid; // border-bottom: #eee 2px solid;
size: 12px; size: 12px;
font-weight: bold; color: orange;
} }
} }
</style> </style>
<template> <template>
<img :src="downUrl + src" /> <div class="img-p">
<img :src="downUrl + src" />
</div>
</template> </template>
<script> <script>
export default { export default {
...@@ -23,4 +25,9 @@ export default { ...@@ -23,4 +25,9 @@ export default {
}, },
}, },
}; };
</script> </script>
\ No newline at end of file <style lang="less" scoped>
.img-p {
text-align: center;
}
</style>
\ No newline at end of file
...@@ -2011,6 +2011,8 @@ document_category: { ...@@ -2011,6 +2011,8 @@ document_category: {
deletionTime: '删除时间', deletionTime: '删除时间',
deleterUserId: '删除人', deleterUserId: '删除人',
projectId: '项目id', projectId: '项目id',
direction:"方向",
deliverable:"交付物",
upId: '父级', upId: '父级',
title: '标题', title: '标题',
status: '状态', status: '状态',
...@@ -2135,5 +2137,19 @@ document_category: { ...@@ -2135,5 +2137,19 @@ document_category: {
content: '内容', content: '内容',
upId: '计划或任务id', upId: '计划或任务id',
projectId: '项目id', projectId: '项目id',
},
project_template: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
title: '标题',
note: '请注意',
template: '模板',
attachment: '附件',
type: '模版类型',
} }
} }
\ No newline at end of file
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
</Row> </Row>
<div class="fa">产品名称:{{ li.productName }}</div> <div class="fa">产品名称:{{ li.productName }}</div>
<div class="time-s">产品数量:{{ li.quantity }}</div> <div class="time-s">产品数量:{{ li.quantity }}</div>
<!-- <div class="time-s"> <div class="time-s">
<span>工序:{{li.drawnNumber}}</span> <span>工序:{{li.drawnNumber}}</span>
</div> --> </div>
<div class="time-s"> <div class="time-s">
{{ li.demandFinishDate }} ~ {{ li.demandStartDate }} {{ li.demandFinishDate }} ~ {{ li.demandStartDate }}
</div> </div>
...@@ -68,11 +68,11 @@ ...@@ -68,11 +68,11 @@
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem v-if="formItem.radio == 0"> <FormItem v-if="formItem.radio == 0">
<UserSelect v-model="user" :multiple="true" /> <UserSelect v-model="user" :multiple="true" :type="1" />
</FormItem> </FormItem>
<FormItem label="班组" v-if="formItem.radio == 1"> <FormItem label="班组" v-if="formItem.radio == 1">
<DepartmentSelect <DepartmentSelect
:type="1" :type="2"
v-model="formItem.shopId" v-model="formItem.shopId"
style="width: 350px" style="width: 350px"
/> />
......
...@@ -409,6 +409,7 @@ export default { ...@@ -409,6 +409,7 @@ export default {
Api.fltwostepschedule(data).then((r) => { Api.fltwostepschedule(data).then((r) => {
if (r.result) { if (r.result) {
this.$Message.success("下发成功"); this.$Message.success("下发成功");
this.result = [];
this.orderlist(this.status); this.orderlist(this.status);
} else { } else {
this.$Message.info("下发失败"); this.$Message.info("下发失败");
......
<template> <template>
<div class="monitoring h100"> <div class="monitoring h100">
<DataGrid :columns="columns" ref="grid" :action="action"> <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline style="margin-top:5px;"> <Form ref="formInline" :model="easySearch" inline style="margin-top:5px;">
<FormItem prop="productingpreparationpeople" style="width:200px"> <FormItem prop="productingpreparationpeople" style="width:200px">
...@@ -529,7 +529,7 @@ export default { ...@@ -529,7 +529,7 @@ export default {
// this.curId = 0 // this.curId = 0
}, },
start(row) { start(row) {
this.laster = this.$store.state.userInfo.login_id; this.laster = this.$store.state.userInfo.userId,
this.$Modal.confirm({ this.$Modal.confirm({
title: "提示", title: "提示",
content: "<p>确定要启动,是否继续?</p>", content: "<p>确定要启动,是否继续?</p>",
...@@ -556,7 +556,7 @@ export default { ...@@ -556,7 +556,7 @@ export default {
this.SpeedModal = false; this.SpeedModal = false;
}, },
suspend(row) { suspend(row) {
console.log(row); // console.log(row);
this.suspendModal = true; this.suspendModal = true;
this.rowSuspend = row; this.rowSuspend = row;
this.$refs.addBug.getEid(); this.$refs.addBug.getEid();
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
ref="grid" ref="grid"
:action="action" :action="action"
:conditions="easySearch" :conditions="easySearch"
:format="formatFun"
:tool="false" :tool="false"
:height="tdHeight" :height="tdHeight"
></DataGrid> ></DataGrid>
...@@ -101,6 +102,7 @@ export default { ...@@ -101,6 +102,7 @@ export default {
easy: true, easy: true,
high: true, high: true,
align: "left", align: "left",
type: "user",
}, },
{ {
key: "laster", key: "laster",
...@@ -108,6 +110,7 @@ export default { ...@@ -108,6 +110,7 @@ export default {
easy: true, easy: true,
high: true, high: true,
align: "left", align: "left",
type: "user",
}, },
{ {
key: "lastModificationTime", key: "lastModificationTime",
...@@ -189,7 +192,7 @@ export default { ...@@ -189,7 +192,7 @@ export default {
eid: Number, eid: Number,
}, },
mounted() { mounted() {
this.$refs.grid.reload(this.easySearch); // this.$refs.grid.reload(this.easySearch);
// if (this.eid) { // if (this.eid) {
// this.loadList(); // this.loadList();
// } // }
...@@ -208,6 +211,17 @@ export default { ...@@ -208,6 +211,17 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
//格式化原始数据
formatFun(data) {
data.map((e) => {
if (e.laster) {
e.laster = parseInt(e.laster);
} else if (e.creator) {
e.creator = parseInt(e.creator);
}
});
return data;
},
loadList() { loadList() {
let params = { let params = {
FilterText: 'order_id="' + this.eid + '"', FilterText: 'order_id="' + this.eid + '"',
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
productName: this.rowSuspend.productName, productName: this.rowSuspend.productName,
drawnNumber: this.rowSuspend.drawnNumber, drawnNumber: this.rowSuspend.drawnNumber,
status: 5, status: 5,
creator: this.$store.state.userInfo.login_id, creator: this.$store.state.userInfo.userId,
}; };
Api.create(data) Api.create(data)
......
...@@ -51,6 +51,23 @@ ...@@ -51,6 +51,23 @@
><FormItem :label="l('upId')" prop="upId"> ><FormItem :label="l('upId')" prop="upId">
<Input v-model="entity.upId"></Input> </FormItem <Input v-model="entity.upId"></Input> </FormItem
></Col> --> ></Col> -->
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_plan.Type"
v-model="entity.type"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('direction')" prop="direction">
<Dictionary
code="mes.project_plan.direction"
v-model="entity.direction"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="24" <Col :span="24"
><FormItem :label="l('title')" prop="title"> ><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem <Input v-model="entity.title"> </Input> </FormItem
...@@ -73,32 +90,34 @@ ...@@ -73,32 +90,34 @@
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('startDate')" prop="startDate"> ><FormItem :label="l('startDate')" prop="startDate">
<DatePicker <DateRange v-model="entity" edit></DateRange> </FormItem
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col> ></Col>
<Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('endDate')" prop="endDate"> ><FormItem :label="l('endDate')" prop="endDate">
<DatePicker <DatePicker
type="date" type="date"
v-model="entity.endDate" v-model="entity.endDate"
></DatePicker> </FormItem ></DatePicker> </FormItem
></Col> ></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('type')" prop="type"> ><FormItem :label="l('executor')" prop="executor">
<UserGroup
v-model="entity.executor"
multiple
:projectId="v.projectId"
></UserGroup>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('deliverable')" prop="deliverable">
<Dictionary <Dictionary
code="mes.project_plan.Type" code="mes.project_plan.deliverable"
v-model="entity.type" v-model="entity.deliverable"
type="radio" type="radio"
></Dictionary> </FormItem ></Dictionary>
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<UserGroup v-model="entity.executor" multiple :projectId="v.projectId"></UserGroup>
</FormItem> </FormItem>
</Col </Col>
>
<Col :span="24" <Col :span="24"
><FormItem :label="l('attachment')" prop="attachment"> ><FormItem :label="l('attachment')" prop="attachment">
<files <files
...@@ -137,8 +156,11 @@ export default { ...@@ -137,8 +156,11 @@ export default {
endDate: null, endDate: null,
type: 0, type: 0,
attachment: "", attachment: "",
deliverable: 0,
direction: 0,
executor: [], executor: [],
}, },
daterange: [],
parmsName: "app=material&eid=1&name=ProjectPlan", parmsName: "app=material&eid=1&name=ProjectPlan",
rules: { rules: {
title: [{ required: true, message: "必填", trigger: "blur" }], title: [{ required: true, message: "必填", trigger: "blur" }],
...@@ -155,6 +177,9 @@ export default { ...@@ -155,6 +177,9 @@ export default {
// } // }
}, },
methods: { methods: {
dateChange(v, t) {
console.warn(v, t);
},
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<!-- <Col :span="12" <!-- <Col :span="12"
...@@ -51,6 +51,23 @@ ...@@ -51,6 +51,23 @@
><FormItem :label="l('upId')" prop="upId"> ><FormItem :label="l('upId')" prop="upId">
<Input v-model="entity.upId"></Input> </FormItem <Input v-model="entity.upId"></Input> </FormItem
></Col> --> ></Col> -->
<Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_plan.Type"
v-model="entity.type"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="12"
><FormItem :label="l('direction')" prop="direction">
<Dictionary
code="mes.project_plan.direction"
v-model="entity.direction"
type="radio"
></Dictionary> </FormItem
></Col>
<Col :span="24" <Col :span="24"
><FormItem :label="l('title')" prop="title"> ><FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"> </Input> </FormItem <Input v-model="entity.title"> </Input> </FormItem
...@@ -73,32 +90,34 @@ ...@@ -73,32 +90,34 @@
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('startDate')" prop="startDate"> ><FormItem :label="l('startDate')" prop="startDate">
<DatePicker <DateRange v-model="entity" edit></DateRange> </FormItem
type="date"
v-model="entity.startDate"
></DatePicker> </FormItem
></Col> ></Col>
<Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('endDate')" prop="endDate"> ><FormItem :label="l('endDate')" prop="endDate">
<DatePicker <DatePicker
type="date" type="date"
v-model="entity.endDate" v-model="entity.endDate"
></DatePicker> </FormItem ></DatePicker> </FormItem
></Col> ></Col> -->
<Col :span="12" <Col :span="12"
><FormItem :label="l('type')" prop="type"> ><FormItem :label="l('executor')" prop="executor">
<UserGroup
v-model="entity.executor"
multiple
:projectId="v.projectId"
></UserGroup>
</FormItem>
</Col>
<Col :span="12"
><FormItem :label="l('deliverable')" prop="deliverable">
<Dictionary <Dictionary
code="mes.project_plan.Type" code="mes.project_plan.deliverable"
v-model="entity.type" v-model="entity.deliverable"
type="radio" type="radio"
></Dictionary> </FormItem ></Dictionary>
></Col>
<Col :span="12"
><FormItem :label="l('executor')" prop="executor">
<UserGroup v-model="entity.executor" multiple :projectId="entity.projectId"></UserGroup>
</FormItem> </FormItem>
</Col </Col>
>
<Col :span="24" <Col :span="24"
><FormItem :label="l('attachment')" prop="attachment"> ><FormItem :label="l('attachment')" prop="attachment">
<files <files
......
...@@ -71,7 +71,80 @@ export default { ...@@ -71,7 +71,80 @@ export default {
// { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true }, // { key:"projectId",title:this.l("projectId") ,align:"left" ,high:true },
// { key:"upId",title:this.l("upId") ,align:"left" ,high:true }, // { key:"upId",title:this.l("upId") ,align:"left" ,high:true },
// { type: "selection", width: 80, align: "center" }, // { type: "selection", width: 80, align: "center" },
{
key: "type",
width: 90,
title: this.l("type"),
align: "center",
high: true,
code: "mes.project_plan.Type",
attr:{
type:'icon'
}
},
{
key: "direction",
title: this.l("direction"),
align: "center",
code: "mes.project_plan.direction",
width:80,
easy: true,
high: true,
},
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
{
key: "status",
title: this.l("status"),
align: "center",
width:80,
high: true,
code: "mes.project_plan.Status",
},
// {
// key: "startDate",
// title: this.l("startDate"),
// align: "left",
// high: true
// ,type:"date"
// },
// { key: "endDate", title: this.l("endDate"), align: "left", high: true,type:"date" },
{ key: "endDate",width:250, title: "计划日期", align: "left",render(h,param) {
return h('DateRange',{
attrs:{
value:param.row
}
})
}, },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{ {
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type:"users",
},
{
key: "deliverable",
title: this.l("deliverable"),
code: "mes.project_plan.deliverable",
width:80,
align: "center",
easy: true,
high: true,
},
{
title: "操作", title: "操作",
key: "action", key: "action",
width: 150, width: 150,
...@@ -142,60 +215,7 @@ export default { ...@@ -142,60 +215,7 @@ export default {
]); ]);
}, },
}, },
{
key: "type",
width: 90,
title: this.l("type"),
align: "left",
high: true,
code: "mes.project_plan.Type",
attr:{
type:'icon'
}
},
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
code: "mes.project_plan.Status",
},
// {
// key: "startDate",
// title: this.l("startDate"),
// align: "left",
// high: true
// ,type:"date"
// },
// { key: "endDate", title: this.l("endDate"), align: "left", high: true,type:"date" },
{ key: "endDate", title: "计划日期", align: "left",render(h,param) {
return h('DateRange',{
attrs:{
value:param.row
}
})
}, },
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type:"users",
},
], ],
}; };
}, },
......
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
this.curId = row.id; this.curId = row.id;
this.title = "项目团队---" + row.title; this.title = "项目团队---" + row.title;
this.fullscreen = true; this.fullscreen = true;
this.detail = () => import('../groupUser/index1') this.detail = () => import('../../groupUser/index1')
this.modal = true; this.modal = true;
}, },
cancel() { cancel() {
...@@ -192,7 +192,3 @@ export default { ...@@ -192,7 +192,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
</style>
<template>
<div class="setings">
<Menu
mode="horizontal"
:theme="theme1"
active-name="1"
@on-select="tabsSel"
>
<MenuItem name="1">
<Icon type="md-contacts" />
团队管理
</MenuItem>
<MenuItem name="2">
<Icon type="ios-document" />
项目模板
</MenuItem>
</Menu>
<keep-alive>
<component v-bind:is="detail"></component>
</keep-alive>
</div>
</template>
<script>
import Api from "../../../api";
export default {
name: "projectSetings",
data() {
return {
theme1: "light",
detail: null,
};
},
mounted() {
this.group();
},
methods: {
tabsSel(name) {
if (name == 1) {
this.group();
} else {
this.template();
}
},
group() {
this.detail = () => import("./group");
},
template() {
this.detail = () => import("./templates");
},
},
};
</script>
<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('template')" prop="template">
<Input v-model="entity.template"> </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('type')" prop="type">
<Dictionary code="project.task.level" v-model="entity.type"></Dictionary>
<!-- <Dictionary
code="mes.project_template.Type"
v-model="entity.type"
></Dictionary> -->
</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: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
title: "",
note: "",
template: "",
attachment: "",
type: null,
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
v: Object,
eid: String,
},
mounted() {
if (this.eid ) {
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_template" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v !="") {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${material}/projecttemplate/paged`,
paged(params) {
return Api.post(`${material}/projecttemplate/paged`, params);
},
get(params) {
return Api.get(`${material}/projecttemplate/get`, params);
},
create(params) {
return Api.post(`${material}/projecttemplate/create`, params);
},
update(params) {
return Api.post(`${material}/projecttemplate/update`, params);
},
delete(id) {
return Api.delete(`${material}/projecttemplate/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${material}/projecttemplate/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="12" :name="l('template')">{{ entity.template }}</Filed>
<Filed :span="12" :name="l('attachment')">{{ entity.attachment }}</Filed>
<Filed :span="12" :name="l('type')">{{ entity.type }}</Filed>
<Filed :span="24" :name="l('note')">{{ entity.note }}</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: String,
},
mounted() {
if (this.eid ) {
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_template" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v !="") {
this.load(v);
}
},
},
};
</script>
<style lang="less" scoped>
.detail{
width: 100%;
}
</style>style>
\ 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('template')" prop="template">
<Input v-model="entity.template"> </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('type')" prop="type">
<!-- code="mes.project_template.Type" -->
<Dictionary
code="project.task.level"
v-model="entity.type"
></Dictionary> </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: String,
},
mounted() {
if (this.eid) {
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_template" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != "") {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action"
><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>
</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_template 10/29/2020 5:40:26 PM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// align: "left",
// high: true,
// },
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// align: "left",
// high: true,
// },
// {
// key: "lastModificationTime",
// title: this.l("lastModificationTime"),
// align: "left",
// high: true,
// },
// {
// key: "lastModifierUserId",
// title: this.l("lastModifierUserId"),
// align: "left",
// high: true,
// },
// {
// key: "isDeleted",
// title: this.l("isDeleted"),
// align: "left",
// high: true,
// },
// {
// key: "deletionTime",
// title: this.l("deletionTime"),
// align: "left",
// high: true,
// },
// {
// key: "deleterUserId",
// title: this.l("deleterUserId"),
// align: "left",
// high: true,
// },
{
key: "title",
title: this.l("title"),
align: "left",
easy: true,
high: true,
},
{
key: "attachment",
title: this.l("attachment"),
align: "left",
high: true,
},
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
code:"project.task.level"
// code: "mes.project_template.Type",
},
{
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) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = "";
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = "";
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) {
/*
project_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'请注意',
template:'模板',
attachment:'附件',
type:'模版类型',
}
*/
let vkey = "project_template" + "." + 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.attachment.show"
><FormItem :label="l('attachment')" prop="attachment">
<Input v-model="condition.attachment.value"> </Input> </FormItem
></Col>
<Col :span="12" :v-if="condition.type.show"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="mes.project_template.Type"
v-model="condition.type.value"
></Dictionary> </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 },
attachment: { op: "Equal", value: null, show: true },
type: { op: "Equal", value: null, show: true },
},
};
},
methods: {
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "project_template" + "." + 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