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