Commit 4f89e496 authored by 仇晓婷's avatar 仇晓婷

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

parents 2bf71804 c6468b1f
<template> <template>
<div class="record"> <div class="record">
<div v-if="load" style="width:100px;margin:0 auto;padding-top:260px;"> <div v-if="load" style="width:100px;margin:0 auto;padding-top:260px;">
<Spin size="large"></Spin> <Spin size="large"></Spin>
</div> </div>
...@@ -18,23 +18,13 @@ ...@@ -18,23 +18,13 @@
<Col span="24"> <Col span="24">
<FormItem label="选择序列号" prop="num"> <FormItem label="选择序列号" prop="num">
<Select v-model="entity.num" multiple> <Select v-model="entity.num" multiple>
<Option <Option v-for="(item,index) in numList" :value="item.productcodes" :key="index">{{ item.productcodes}}</Option>
v-for="(item,index) in numList"
:value="item.productcodes"
:key="index"
>{{ item.productcodes}}</Option>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col span="24"> <Col span="24">
<FormItem label="选择分卡原因" prop="reason"> <FormItem label="选择分卡原因" prop="reason">
<Select v-model="entity.reason" style="width:260px"> <dictionary code="taskList.split.reson" v-model="entity.reason" style="width:240px"></dictionary>
<Option
v-for="(item,index) in reasonList"
:value="item.value"
:key="index"
>{{ item.label }}</Option>
</Select>
</FormItem> </FormItem>
</Col> </Col>
<Col span="24"> <Col span="24">
...@@ -71,8 +61,9 @@ ...@@ -71,8 +61,9 @@
</Col> </Col>
</Row> </Row>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import EntryPause from "./entryPause"; import EntryPause from "./entryPause";
...@@ -98,8 +89,7 @@ export default { ...@@ -98,8 +89,7 @@ export default {
routingDetailId: null, routingDetailId: null,
dispatchId: null dispatchId: null
}, },
columns: [ columns: [{
{
key: "detailId", key: "detailId",
title: this.l("detailId"), title: this.l("detailId"),
align: "center", align: "center",
...@@ -162,9 +152,9 @@ export default { ...@@ -162,9 +152,9 @@ export default {
return h( return h(
"span", "span",
// this.sliceStr(params.row.actualStartDate + ' ', 0, 10), // this.sliceStr(params.row.actualStartDate + ' ', 0, 10),
params.row.actualStartDate == "0001-01-01 00:00:00" params.row.actualStartDate == "0001-01-01 00:00:00" ?
? "" "" :
: params.row.actualStartDate params.row.actualStartDate
); );
} }
}, },
...@@ -177,9 +167,9 @@ export default { ...@@ -177,9 +167,9 @@ export default {
return h( return h(
"span", "span",
// this.sliceStr(params.row.actualFinishDate + ' ', 0, 10), // this.sliceStr(params.row.actualFinishDate + ' ', 0, 10),
params.row.actualFinishDate == "0001-01-01 00:00:00" params.row.actualFinishDate == "0001-01-01 00:00:00" ?
? "" "" :
: params.row.actualFinishDate params.row.actualFinishDate
); );
} }
}, },
...@@ -204,39 +194,47 @@ export default { ...@@ -204,39 +194,47 @@ export default {
width: 120, width: 120,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h( h(
"op", "op", {
{
props: { props: {
oprate: "edit", oprate: "edit",
title: "暂停" title: "暂停"
//msg: "确定暂停工序:" + params.row.detailName + "?" //msg: "确定暂停工序:" + params.row.detailName + "?"
}, },
style: params.row.status == 14 ? "" : "display:none", style: params.row.status == 14 ? "" : "display:none",
on: { click: () => this.pause(params.row, params.index) } on: {
click: () => this.pause(params.row, params.index)
}
}, },
"暂停" "暂停"
), ),
h( h(
"op", "op", {
{ props: {
props: { oprate: "edit", title: "分卡" }, oprate: "edit",
title: "分卡"
},
style: params.row.status == 5 ? "" : "display:none", style: params.row.status == 5 ? "" : "display:none",
on: { click: () => this.split(params.row, params.index) } on: {
click: () => this.split(params.row, params.index)
}
}, },
"分卡" "分卡"
), ),
h( h(
"op", "op", {
{
props: { props: {
oprate: "delete", oprate: "delete",
title: "继续", title: "继续",
msg: "确定继续执行工序:" + params.row.detailName + "?" msg: "确定继续执行工序:" + params.row.detailName + "?"
}, },
style: params.row.status == 5 ? "" : "display:none", style: params.row.status == 5 ? "" : "display:none",
on: { click: () => this.continue(params.row, params.index) } on: {
click: () => this.continue(params.row, params.index)
}
}, },
"继续" "继续"
) )
...@@ -246,53 +244,31 @@ export default { ...@@ -246,53 +244,31 @@ export default {
], ],
listTask: [], listTask: [],
numList: [], numList: [],
reasonList: [
{
value: 1,
label: "分卡原因1"
},
{
value: 2,
label: "分卡原因2"
},
{
value: 3,
label: "分卡原因3"
}
],
rules: { rules: {
num: [ num: [{
{
required: true, required: true,
message: "请选择分卡原因", message: "请选择分卡原因",
trigger: "change", trigger: "change",
type: "array" type: "array"
} }],
], reason: [{
reason: [
{
required: true, required: true,
message: "请选择分卡原因", message: "请选择分卡原因",
trigger: "change", trigger: "change",
type: "number" type: "number"
} }],
], action: [{
action: [
{
required: true, required: true,
message: "请选择操作", message: "请选择操作",
trigger: "change", trigger: "change",
type: "number" type: "number"
} }],
], scheduleType: [{
scheduleType: [
{
required: true, required: true,
message: "请选择排产类型", message: "请选择排产类型",
trigger: "change", trigger: "change",
type: "number" type: "number"
} }]
]
} }
}; };
}, },
...@@ -302,7 +278,10 @@ export default { ...@@ -302,7 +278,10 @@ export default {
executeId: Number, executeId: Number,
orderId: Number orderId: Number
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() {}, created() {},
...@@ -324,11 +303,11 @@ export default { ...@@ -324,11 +303,11 @@ export default {
}, },
getProduct(row) { getProduct(row) {
let params = { let params = {
dispatch_id:row.id, dispatch_id: row.id,
execute_id:row.executeId, execute_id: row.executeId,
order_id:row.orderId, order_id: row.orderId,
RoutingHeaderId:row.routingHeaderId, RoutingHeaderId: row.routingHeaderId,
RoutingDetailId:row.detailId, RoutingDetailId: row.detailId,
}; };
Api.getentryproductcode(params).then(res => { Api.getentryproductcode(params).then(res => {
if (res.success) { if (res.success) {
...@@ -400,7 +379,7 @@ export default { ...@@ -400,7 +379,7 @@ export default {
this.workOrderPauseModal = false; this.workOrderPauseModal = false;
this.result[this.index].status = 5; this.result[this.index].status = 5;
}, },
continue(row, index) { continue (row, index) {
this.index = index; this.index = index;
//继续工单 //继续工单
let params = { let params = {
...@@ -439,11 +418,13 @@ export default { ...@@ -439,11 +418,13 @@ export default {
} }
}; };
</script> </script>
<style lang='less' scope>
<style lang="less">
.scheduleTypeSelect { .scheduleTypeSelect {
display: inline; display: inline;
width: 180px; width: 180px;
margin-left: -110px; margin-left: -110px;
.ivu-select { .ivu-select {
width: 180px; width: 180px;
} }
......
...@@ -8,20 +8,18 @@ ...@@ -8,20 +8,18 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="mes.project_plan_record.Status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<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">
<files ref="refFile" :parms="parms" files />
</Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -34,8 +32,12 @@ ...@@ -34,8 +32,12 @@
<script> <script>
import Api from './api' import Api from './api'
import iQuill from '@/components/quill'
export default { export default {
name: 'Add', name: 'Add',
components: {
iQuill
},
data() { data() {
return { return {
disabled: false, disabled: false,
...@@ -56,6 +58,12 @@ export default { ...@@ -56,6 +58,12 @@ export default {
attachment: "", attachment: "",
taskId: "" taskId: ""
}, },
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
rules: { rules: {
name: [{ name: [{
required: true, required: true,
...@@ -72,12 +80,18 @@ export default { ...@@ -72,12 +80,18 @@ export default {
mounted() { mounted() {
if (this.eid != "") { if (this.eid != "") {
this.load(this.eid); this.load(this.eid);
this.parms.eid = this.$u.guid();
} }
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.attachment = this.parms.eid;
} else {
this.entity.attachment = "";
}
this.disabled = true; this.disabled = true;
this.entity.taskId = this.eid this.entity.taskId = this.eid
Api.create(this.entity).then((r) => { Api.create(this.entity).then((r) => {
...@@ -107,6 +121,27 @@ export default { ...@@ -107,6 +121,27 @@ export default {
this.entity.id = 0; this.entity.id = 0;
}); });
}, },
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
}
},
l(key) { l(key) {
key = "project_plan_record" + "." + key; key = "project_plan_record" + "." + key;
return this.$t(key) return this.$t(key)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem> <FormItem>
<div class="taskMenu"> <div class="taskMenu">
<Menu mode="horizontal" active-name="2" @on-select="onSelect"> <Menu mode="horizontal" active-name="2">
<MenuItem name="1"> <MenuItem name="1">
所有 所有
</MenuItem> </MenuItem>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</div> </div>
</FormItem> </FormItem>
<FormItem style="float:right"> <FormItem style="float:right">
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add">新增记录</Button>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
...@@ -73,14 +73,28 @@ ...@@ -73,14 +73,28 @@
</Col> </Col>
<Col span="19"> <Col span="19">
<div class="boxBoder"> <div class="boxBoder">
<Timeline> <Timeline v-if="recordList&&recordList.length>0">
<TimelineItem v-for="(item,index) in recordList" :key="index"> <TimelineItem v-for="(item,index) in recordList" :key="index" v-if="recordList&&recordList.length>0">
<p class="content">{{item.creationTime}}</p> <p class="content">{{item.creationTime}}</p>
<p class="content"> <p class="content">
<User :value="item.creatorUserId"></User> 关闭了 任务 1089 测试任务 <User :value="item.creatorUserId"></User>&nbsp;&nbsp;新增:{{item.title}}&nbsp;&nbsp;
<!--
<Tooltip max-width="400" v-if="item.note">
<a>详细信息</a>
<div slot="content">
<div v-html=" item.note"></div>
</div>
</Tooltip>
&nbsp;&nbsp;
-->
</p>
<p v-if="item.note">
<div class="pl10" v-html="item.note"></div>
</p> </p>
<p class="pl10" v-if="item.attachment"><a @click="viewFiles(item.attachment)">查看附件</a></p>
</TimelineItem> </TimelineItem>
</Timeline> </Timeline>
<p class="content" v-else>暂无数据</p>
</div> </div>
</Col> </Col>
</Row> </Row>
...@@ -89,6 +103,9 @@ ...@@ -89,6 +103,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>
...@@ -117,6 +134,7 @@ export default { ...@@ -117,6 +134,7 @@ export default {
value: null value: null
} }
}, },
modalFiles: false,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
...@@ -258,7 +276,13 @@ export default { ...@@ -258,7 +276,13 @@ export default {
} }
}, },
], ],
recordList: [] recordList: [],
parms: {
app: "taskRecord",
eid: null,
name: "",
field: "",
},
} }
}, },
mounted() { mounted() {
...@@ -335,6 +359,10 @@ export default { ...@@ -335,6 +359,10 @@ export default {
this.curId = 0; this.curId = 0;
this.modal = false this.modal = false
}, },
viewFiles(val) {
this.parms.eid = val;
this.modalFiles = true;
},
l(key) { l(key) {
let vkey = "project_plan_record" + "." + key; let vkey = "project_plan_record" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key
......
...@@ -5,71 +5,19 @@ ...@@ -5,71 +5,19 @@
<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="12">
<FormItem :label="l('level')" prop="level"> <FormItem :label="l('level')" prop="level">
<Dictionary code="project.task.level" v-model="entity.level"></Dictionary> <Dictionary code="project.task.level" v-model="entity.level"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('projectTitle')" prop="projectTitle"> <Input v-model="entity.projectTitle"> </Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('planTitle')" prop="planTitle"> <Input v-model="entity.planTitle"> </Input>
</FormItem>
</Col>
<Col :span="12" v-if="false">
<FormItem :label="l('planId')" prop="planId">
<Input v-model="entity.planId"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="false">
<FormItem :label="l('projectId')" prop="projectId">
<Input v-model="entity.projectId"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId"> <FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="entity.userId" /></Input> <UserSelect ref="userSelected" v-model="entity.userId" />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('userIds')" prop="userIds"> <Input v-model="entity.userIds" type="textarea" :rows="5"></Input> <FormItem :label="l('note')" prop="note">
</FormItem> <i-quill v-model="entity.note" :height="300" v-paste="handleImg" />
</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('plansToStartDate')" prop="plansToStartDate">
<DatePicker type="date" v-model="entity.plansToStartDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('plansToEndTime')" prop="plansToEndTime">
<DatePicker type="date" v-model="entity.plansToEndTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('completePercentage')" prop="completePercentage">
<InputNumber v-model="entity.completePercentage"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('note')" prop="note"> <Input v-model="entity.note"> </Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('upTaskId')" prop="upTaskId">
<InputNumber v-model="entity.upTaskId"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -82,8 +30,12 @@ ...@@ -82,8 +30,12 @@
<script> <script>
import Api from './api' import Api from './api'
import iQuill from '@/components/quill'
export default { export default {
name: 'Add', name: 'Add',
components: {
iQuill
},
data() { data() {
return { return {
disabled: false, disabled: false,
...@@ -169,6 +121,27 @@ export default { ...@@ -169,6 +121,27 @@ export default {
this.entity.id = 0; this.entity.id = 0;
}); });
}, },
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
}
},
l(key) { l(key) {
key = "project_task" + "." + key; key = "project_task" + "." + key;
return this.$t(key) return this.$t(key)
......
<template> <template>
<div class="detail"> <div class="detail" style="width:100%">
<Row style="height:180px"> <Row style="height:284px">
<Filed :span="6" :name="l('creationTime')">{{entity.creationTime}}</Filed> <Filed :span="6" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="6" :name="l('creatorUserId')"> <Filed :span="6" :name="l('creatorUserId')">
<User :value="entity.creatorUserId"></User> <User :value="entity.creatorUserId"></User>
</Filed> </Filed>
<Filed :span="6" :name="l('title')">{{entity.title}}</Filed> <Filed :span="6" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="6" :name="l('level')">{{entity.level}}</Filed> <Filed :span="6" :name="l('level')">
<Filed :span="6" :name="l('status')">{{entity.status}}</Filed> <state code="project.task.level" :value="entity.level" type="text"></state>
<Filed :span="6" :name="l('projectTitle')">{{entity.projectTitle}}</Filed> </Filed>
<Filed :span="6" :name="l('planTitle')">{{entity.planTitle}}</Filed> <Filed :span="6" :name="l('status')">
<Filed :span="6" :name="l('userIds')">{{entity.userIds}}</Filed> <state code="project.task.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="6" :name="l('userId')">{{entity.userId}}</Filed> <Filed :span="6" :name="l('userId')">{{entity.userId}}</Filed>
<Filed :span="6" :name="l('endDate')">{{entity.endDate}}</Filed> <Filed :span="6" :name="l('endDate')">{{entity.endDate}}</Filed>
<Filed :span="6" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="6" :name="l('startDate')">{{entity.startDate}}</Filed> <Filed :span="6" :name="l('startDate')">{{entity.startDate}}</Filed>
<Filed :span="6" :name="l('plansToStartDate')">{{entity.plansToStartDate}}</Filed> <Filed :span="24" :name="l('note')">
<Filed :span="6" :name="l('plansToEndTime')">{{entity.plansToEndTime}}</Filed> <div style="height:200px" v-html="entity.note" class="tex_in10"></div>
<Filed :span="6" :name="l('completePercentage')">{{entity.completePercentage}}</Filed> </Filed>
<Filed :span="6" :name="l('upTaskId')">{{entity.upTaskId}}</Filed>
</Row> </Row>
<component :is="detail" :eid="curId" /> <component :is="detail" :eid="curId" />
</div> </div>
...@@ -84,3 +83,10 @@ export default { ...@@ -84,3 +83,10 @@ export default {
} }
} }
</script> </script>
<style scoped>
.tex_in10 {
text-indent: 12px;
text-align: inherit !important;
}
</style>
...@@ -6,74 +6,19 @@ ...@@ -6,74 +6,19 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('planId')" prop="planId">
<Input v-model="entity.planId"></Input>
</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('level')" prop="level"> <FormItem :label="l('level')" prop="level">
<Dictionary code="project.task.level" v-model="entity.level"></Dictionary> <Dictionary code="project.task.level" v-model="entity.level"></Dictionary>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="project.task.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('projectTitle')" prop="projectTitle"> <Input v-model="entity.projectTitle"> </Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('planTitle')" prop="planTitle"> <Input v-model="entity.planTitle"> </Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('userIds')" prop="userIds"> <Input v-model="entity.userIds" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId"> <FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="entity.userId" /></Input> <UserSelect ref="userSelected" v-model="entity.userId" /></Input>
</FormItem> </FormItem>
</Col> </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('plansToStartDate')" prop="plansToStartDate">
<DatePicker type="date" v-model="entity.plansToStartDate"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('plansToEndTime')" prop="plansToEndTime">
<DatePicker type="date" v-model="entity.plansToEndTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('completePercentage')" prop="completePercentage">
<InputNumber v-model="entity.completePercentage"></InputNumber>
</FormItem>
</Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('note')" prop="note"> <Input v-model="entity.note"> </Input> <FormItem :label="l('note')" prop="note">
</FormItem> <i-quill v-model="entity.note" :height="300" v-paste="handleImg" /></Input>
</Col>
<Col :span="12">
<FormItem :label="l('upTaskId')" prop="upTaskId">
<Input v-model="entity.upTaskId"></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -85,9 +30,16 @@ ...@@ -85,9 +30,16 @@
</template> </template>
<script> <script>
import {
replace
} from 'lodash';
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,
...@@ -121,6 +73,7 @@ export default { ...@@ -121,6 +73,7 @@ export default {
id: v id: v
}).then(r => { }).then(r => {
this.entity = r.result; this.entity = r.result;
this.entity.userId = parseInt(r.result.userId)
}) })
}, },
handleSubmit() { handleSubmit() {
...@@ -146,6 +99,27 @@ export default { ...@@ -146,6 +99,27 @@ export default {
handleClose() { handleClose() {
this.$emit('on-close') this.$emit('on-close')
}, },
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
}
},
l(key) { l(key) {
key = "project_task" + "." + key; key = "project_task" + "." + key;
return this.$t(key) return this.$t(key)
......
...@@ -108,12 +108,14 @@ export default { ...@@ -108,12 +108,14 @@ export default {
detail: null, detail: null,
curId: '', curId: '',
fullScreen: false, fullScreen: false,
columns: [{ columns: [
key: "selection", // {
type: "selection", // key: "selection",
width: 50, // type: "selection",
align: "center" // width: 50,
}, { // align: "center"
// },
{
key: "id", key: "id",
title: this.$t("id"), title: this.$t("id"),
align: "left", align: "left",
...@@ -131,7 +133,7 @@ export default { ...@@ -131,7 +133,7 @@ export default {
oprate: 'detail' oprate: 'detail'
}, },
on: { on: {
click: () => this.addRecord(params.row.id) click: () => this.viewRecord(params.row.id)
} }
}, params.row.title) }, params.row.title)
} }
...@@ -179,34 +181,12 @@ export default { ...@@ -179,34 +181,12 @@ export default {
title: this.l("startDate"), title: this.l("startDate"),
align: "center", align: "center",
high: true, high: true,
type: 'date'
}, },
{ {
key: "endDate", key: "endDate",
title: this.l("endDate"), title: this.l("endDate"),
align: "center", align: "center",
high: true, high: true,
type: 'date'
},
{
key: "plansToStartDate",
title: this.l("plansToStartDate"),
align: "center",
high: true,
type: 'date'
},
{
key: "plansToEndTime",
title: this.l("plansToEndTime"),
align: "center",
high: true,
type: 'date'
},
{
key: "completePercentage",
title: this.l("completePercentage"),
align: "left",
high: true
}, },
{ {
key: "note", key: "note",
...@@ -272,6 +252,17 @@ export default { ...@@ -272,6 +252,17 @@ export default {
click: () => params.row.status != 0 ? this.updatestatus(params.row.id, 3) : null click: () => params.row.status != 0 ? this.updatestatus(params.row.id, 3) : null
} }
}), }),
h('op', {
attrs: {
icon: "md-add",
type: "icon",
title: params.row.status != 3 ? "新增记录" : "无法操作",
color: params.row.status != 3 ? "#19be6b" : "#ccc",
},
on: {
click: () => params.row.status != 0 ? this.addRecord(params.row.id) : null
}
}),
h('op', { h('op', {
attrs: { attrs: {
icon: "ios-create-outline", icon: "ios-create-outline",
...@@ -408,11 +399,18 @@ export default { ...@@ -408,11 +399,18 @@ export default {
onSelect(val) { onSelect(val) {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch)
}, },
viewRecord(id) {
this.curId = id;
this.title = "查看记录";
this.fullScreen = true;
this.detail = () => import('./detail')
this.modal = true;
},
addRecord(id) { addRecord(id) {
this.curId = id; this.curId = id;
this.title = "新增记录"; this.title = "新增记录";
this.fullScreen = true; this.fullScreen = true;
this.detail = () => import('./detail') this.detail = () => import('../record/add')
this.modal = true; this.modal = true;
}, },
l(key) { l(key) {
......
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