Commit ba16e0c2 authored by renjintao's avatar renjintao

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

parents aa47556c 4a7599b0
...@@ -1818,9 +1818,8 @@ export default { ...@@ -1818,9 +1818,8 @@ export default {
type: '类型', type: '类型',
attachment: '附件', attachment: '附件',
executor: '执行人', executor: '执行人',
} },
, project_main: {
project_main: {
creationTime: '创建时间', creationTime: '创建时间',
creatorUserId: '创建人', creatorUserId: '创建人',
lastModificationTime: '更新时间', lastModificationTime: '更新时间',
...@@ -1838,7 +1837,5 @@ project_main: { ...@@ -1838,7 +1837,5 @@ project_main: {
startDate: '开始日期', startDate: '开始日期',
endDate: '结束日期', endDate: '结束日期',
businessUnits: '业务单位', businessUnits: '业务单位',
} }
} }
...@@ -155,23 +155,24 @@ export default { ...@@ -155,23 +155,24 @@ export default {
}, },
mounted() { mounted() {
console.log(this); console.log(this);
this.search();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
ok() { ok() {
// this.$refs.grid.load(); this.search();
this.modal = false; this.modal = false;
this.curId = 0; this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch); // this.$refs.grid.reload(this.easySearch);
var params={ var params={
conditions:[] conditions:[]
} }
Api.list(params).then(r=>{ Api.list(params).then(r=>{
this.list=r.result;
}) })
}, },
add() { add() {
...@@ -201,7 +202,7 @@ export default { ...@@ -201,7 +202,7 @@ export default {
remove(id) { remove(id) {
Api.delete(id).then((r) => { Api.delete(id).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.search();
this.$Message.success("删除成功"); this.$Message.success("删除成功");
} }
}); });
......
<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="8">
<FormItem :label="l('picture')" prop="picture">
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
/>
</FormItem>
<div class="img-touxiang">
<img :src="avatorPath" v-if="imgName" @click="imgUrl" class="img1" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
<Col span="16">
<!-- <Col :span="12" <!-- <Col :span="12"
><FormItem :label="l('creationTime')" prop="creationTime"> ><FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker <DatePicker
...@@ -51,32 +71,10 @@ ...@@ -51,32 +71,10 @@
<Col :span="12" <Col :span="12"
><FormItem :label="l('state')" prop="state"> ><FormItem :label="l('state')" prop="state">
<Dictionary <Dictionary
code="mes.project_main.State" code="project.main.state"
v-model="entity.state" v-model="entity.state"
></Dictionary> </FormItem ></Dictionary> </FormItem
></Col> ></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" <Col :span="12"
><FormItem :label="l('startDate')" prop="startDate"> ><FormItem :label="l('startDate')" prop="startDate">
<DatePicker <DatePicker
...@@ -92,9 +90,31 @@ ...@@ -92,9 +90,31 @@
></DatePicker> </FormItem ></DatePicker> </FormItem
></Col> ></Col>
<Col :span="12" <Col :span="12"
><FormItem :label="l('type')" prop="type">
<Dictionary
code="project.main.type"
v-model="entity.type"
></Dictionary> </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('businessUnits')" prop="businessUnits"> ><FormItem :label="l('businessUnits')" prop="businessUnits">
<Input v-model="entity.businessUnits"> </Input> </FormItem <Input v-model="entity.businessUnits"> </Input> </FormItem
></Col> ></Col> -->
<Col :span="24">
<FormItem :label="l('attachment')" prop="attachment">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="24" <Col :span="24"
><FormItem :label="l('note')" prop="note"> ><FormItem :label="l('note')" prop="note">
<Input <Input
...@@ -103,11 +123,10 @@ ...@@ -103,11 +123,10 @@
:rows="5" :rows="5"
></Input> </FormItem ></Input> </FormItem
></Col> ></Col>
</Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled" <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Form>
...@@ -119,6 +138,8 @@ export default { ...@@ -119,6 +138,8 @@ export default {
data() { data() {
return { return {
disabled: false, disabled: false,
imgName: "",
avatorPath: "",
entity: { entity: {
// creationTime: null, // creationTime: null,
creatorUserId: this.$store.state.userInfo.userId, creatorUserId: this.$store.state.userInfo.userId,
...@@ -141,6 +162,13 @@ export default { ...@@ -141,6 +162,13 @@ export default {
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parmsName: "app=material&eid=1&name=ProjectMain",
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
}; };
}, },
props: { props: {
...@@ -148,15 +176,24 @@ export default { ...@@ -148,15 +176,24 @@ export default {
eid: Number, eid: Number,
}, },
mounted() { mounted() {
if (this.eid > 0) { // if (this.eid > 0) {
this.load(this.eid); // this.load(this.eid);
} // }
this.$refs.refmovieFile1.inputShow = false;
this.parms.eid = this.$u.guid();
}, },
methods: { methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; if (this.$refs.refFile.nameList.length > 0) {
this.entity.attachment = this.parms.eid;
} else {
this.entity.attachment = "";
}
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
this.disabled = false; this.disabled = false;
...@@ -198,6 +235,12 @@ export default { ...@@ -198,6 +235,12 @@ export default {
this.load(v); this.load(v);
} }
}, },
imgName(newName, oldName) {
console.log(newName);
const imgPathsArr = JSON.parse(newName);
this.entity.picture = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
}, },
}; };
</script> </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