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

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

parents a68d5a4b 3173b979
...@@ -1876,7 +1876,7 @@ export default { ...@@ -1876,7 +1876,7 @@ export default {
deleterUserId: '删除人', deleterUserId: '删除人',
projectId: '项目id', projectId: '项目id',
planId: '计划id', planId: '计划id',
workHour: '工作时间', workHour: '工',
status: '状态', status: '状态',
title: '标题', title: '标题',
note: '备注', note: '备注',
......
...@@ -259,17 +259,17 @@ export default { ...@@ -259,17 +259,17 @@ export default {
this.$Message.error("未设置结束时间"); this.$Message.error("未设置结束时间");
return return
} }
if(!row.executor){ if(row.executor.length==0){
this.$Message.error("设置执行人"); this.$Message.error("设置执行人");
return return
} }
delete row.chlidren; delete row.chlidren;
delete row.parent; delete row.parent;
console.warn(row) console.warn(row)
var data=JSON.parse(JSON.stringify(row));
data.status=1; row.status=1;
Api.sendtask(data).then(r=>{ Api.sendtask(row).then(r=>{
if(r.result){ if(r.success){
this.$Message.info("任务派发成功!"); this.$Message.info("任务派发成功!");
this.search(); this.search();
} }
......
<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">
<FormItem :label="l('workHour')" prop="workHour"> <FormItem :label="l('workHour')" prop="workHour">
<InputNumber v-model="entity.workHour" :min="0"></InputNumber> <InputNumber v-model="entity.workHour" :min="0"></InputNumber>
......
<template> <template>
<div class="detail"> <div class="detail" style="width:100%">
<Row> <Row>
<Filed :span="12" :name="l('workHour')">{{entity.workHour}}</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="24" :name="l('note')">
<div style="height:200px" v-html="entity.note" class="tex_in10"></div>
</Filed>
<Filed :span="24" :name="l('attachment')"><a @click="viewFiles">查看附件</a></Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed> <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')"> <Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User> <User :value="entity.creatorUserId"></User>
</Filed> </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('projectId')">{{entity.projectId}}</Filed>
<Filed :span="12" :name="l('planId')">{{entity.planId}}</Filed>
<Filed :span="12" :name="l('workHour')">{{entity.workHour}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('attachment')">{{entity.attachment}}</Filed>
<Filed :span="12" :name="l('taskId')">{{entity.taskId}}</Filed>
</Row> </Row>
<Modal v-model="modalFiles" title="查看附件" width="800" footer-hide :mask-closable="false">
<FilesView ref="refFile" :parms="parms" />
</Modal>
</div> </div>
</template> </template>
...@@ -31,6 +26,13 @@ export default { ...@@ -31,6 +26,13 @@ export default {
data() { data() {
return { return {
entity: {}, entity: {},
modalFiles: false,
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
rules: { rules: {
name: [{ name: [{
required: true, required: true,
...@@ -46,10 +48,10 @@ export default { ...@@ -46,10 +48,10 @@ export default {
} }
}, },
props: { props: {
eid: Number eid: String
}, },
mounted() { mounted() {
if (this.eid > 0) { if (this.eid != '' && this.eid != null) {
this.load(this.eid); this.load(this.eid);
} }
}, },
...@@ -65,6 +67,14 @@ export default { ...@@ -65,6 +67,14 @@ export default {
handleClose() { handleClose() {
this.$emit('on-close') this.$emit('on-close')
}, },
viewFiles() {
if (this.entity.attachment) {
this.parms.eid = this.entity.attachment;
this.modalFiles = true;
} else {
this.$Message.error("暂没上传附件");
}
},
l(key) { l(key) {
key = "project_plan_record" + "." + key; key = "project_plan_record" + "." + key;
return this.$t(key) return this.$t(key)
...@@ -72,7 +82,7 @@ export default { ...@@ -72,7 +82,7 @@ export default {
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v > 0) { if (v != '' && v != null) {
this.load(v); this.load(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">
<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('projectId')" prop="projectId"> <Input v-model="entity.projectId"> </Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('planId')" prop="planId"> <Input v-model="entity.planId"> </Input>
</FormItem>
</Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('workHour')" prop="workHour"> <FormItem :label="l('workHour')" prop="workHour">
<InputNumber v-model="entity.workHour"></InputNumber> <InputNumber v-model="entity.workHour" :min="0"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="mes.project_plan_record.Status" v-model="entity.status"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input> <FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="24">
<FormItem :label="l('note')" prop="note"> <Input v-model="entity.note"> </Input> <FormItem :label="l('note')" prop="note">
<i-quill v-model="entity.note" :height="300" v-paste="handleImg" /></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('attachment')" prop="attachment"> <Input v-model="entity.attachment"> </Input> <FormItem :label="l('attachment')" prop="attachment">
</FormItem> <files ref="refFile" :parms="parms" files />
</Col> </Input>
<Col :span="12">
<FormItem :label="l('taskId')" prop="taskId">
<InputNumber v-model="entity.taskId"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -81,8 +31,12 @@ ...@@ -81,8 +31,12 @@
<script> <script>
import Api from './api' import Api from './api'
import iQuill from '@/components/quill'
export default { export default {
name: 'Edit', name: 'Edit',
components: {
iQuill
},
data() { data() {
return { return {
disabled: false, disabled: false,
...@@ -93,14 +47,20 @@ export default { ...@@ -93,14 +47,20 @@ export default {
message: '必填', message: '必填',
trigger: 'blur' trigger: 'blur'
}] }]
} },
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
} }
}, },
props: { props: {
eid: Number eid: String
}, },
mounted() { mounted() {
if (this.eid > 0) { if (this.eid != "" && this.eid != null) {
this.load(this.eid); this.load(this.eid);
} }
}, },
...@@ -110,12 +70,23 @@ export default { ...@@ -110,12 +70,23 @@ export default {
id: v id: v
}).then(r => { }).then(r => {
this.entity = r.result; this.entity = r.result;
if (r.result.attachment && r.result.attachment != "") {
this.parms.eid = r.result.attachment;
} else {
this.parms.eid = this.$u.guid();
}
this.entity.attachment = this.parms.eid;
}) })
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
if (this.$refs.refFile.nameList.length > 0) {
this.entity.attachment = this.parms.eid;
} else {
this.entity.attachment = "";
}
Api.update(this.entity).then((r) => { Api.update(this.entity).then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
...@@ -132,6 +103,27 @@ export default { ...@@ -132,6 +103,27 @@ export default {
} }
}) })
}, },
handleImg(e) {
console.warn(e)
let file = null
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf('image') > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile()
let reader = new FileReader()
reader.readAsDataURL(file)
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>'
this.entity.note += img
}, 1000)
// new R
}
},
handleClose() { handleClose() {
this.$emit('on-close') this.$emit('on-close')
}, },
...@@ -142,7 +134,7 @@ export default { ...@@ -142,7 +134,7 @@ export default {
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v != 0) { if (v != '' && v != null) {
this.load(v); this.load(v);
} }
} }
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<Modal v-model="modalFiles" title="查看附件" width="800" footer-hide :mask-closable="false">
<FilesView ref="refFile" :parms="parms" />
</Modal>
</div> </div>
</template> </template>
...@@ -45,6 +48,13 @@ export default { ...@@ -45,6 +48,13 @@ export default {
} }
}, },
modal: false, modal: false,
modalFiles: false,
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
...@@ -89,29 +99,38 @@ export default { ...@@ -89,29 +99,38 @@ export default {
}, [ }, [
h('op', { h('op', {
attrs: { attrs: {
oprate: 'detail' oprate: 'detail',
icon: "md-eye",
type: "icon",
title: "查看",
}, },
on: { on: {
click: () => this.view(params.row.id) click: () => this.view(params.row.id)
} }
}, '查看'), }),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'), //h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h('op', { h('op', {
attrs: { attrs: {
oprate: 'edit' icon: "md-create",
type: "icon",
oprate: "edit",
title: "编辑",
}, },
on: { on: {
click: () => this.edit(params.row.id) click: () => this.edit(params.row.id)
} }
}, '编辑'), }),
h('op', { h('op', {
attrs: { attrs: {
oprate: 'delete' icon: "md-trash",
type: "icon",
title: "删除",
oprate: 'delete',
}, },
on: { on: {
click: () => this.remove(params.row.id) click: () => this.remove(params.row.id)
} }
}, '删除') })
]) ])
} }
}, },
...@@ -191,7 +210,7 @@ export default { ...@@ -191,7 +210,7 @@ export default {
viewFiles(row) { viewFiles(row) {
if (row.attachment) { if (row.attachment) {
this.parms.eid = row.attachment; this.parms.eid = row.attachment;
this.modal1 = true; this.modalFiles = true;
} else { } else {
this.$Message.error("暂没上传附件"); this.$Message.error("暂没上传附件");
} }
......
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