|
@@ -34,34 +34,67 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
|
|
|
- <!-- 创建人 时间 -->
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="12">
|
|
|
- <a-form-item label="创建人">
|
|
|
- <a-input
|
|
|
- v-decorator="['createBy', { rules: [{ required: false, message: '请输入创建人' }] }]"
|
|
|
- placeholder="系统回显"
|
|
|
- disabled
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
+ <!-- 创建人 时间 新增弹框-->
|
|
|
+ <div v-if="title=='新增企业公告'">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="创建人">
|
|
|
+ <a-input
|
|
|
+ v-decorator="['createBy', { rules: [{ required: false, message: '请输入创建人' }] }]"
|
|
|
+ placeholder="系统回显"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
|
|
|
- <a-col :span="12">
|
|
|
- <a-form-item label="创建日期">
|
|
|
- <a-date-picker
|
|
|
- disabled
|
|
|
- style="width:100%"
|
|
|
- showTime
|
|
|
- format="YYYY-MM-DD HH:mm"
|
|
|
- placeholder="系统回显"
|
|
|
- @change="createTimeChange"
|
|
|
- @ok="createTimeOk"
|
|
|
- v-decorator="['createTime', { rules: [{ required: false, message: '请选择紧创建日期' }] }]"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="创建日期">
|
|
|
+ <a-date-picker
|
|
|
+ disabled
|
|
|
+ style="width:100%"
|
|
|
+ showTime
|
|
|
+ format="YYYY-MM-DD HH:mm"
|
|
|
+ placeholder="系统回显"
|
|
|
+ @change="createTimeChange"
|
|
|
+ @ok="createTimeOk"
|
|
|
+ v-decorator="['createTime', { rules: [{ required: false, message: '请选择紧创建日期' }] }]"
|
|
|
+ />
|
|
|
+
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 编辑的弹框显示 -->
|
|
|
+ <div v-if="title=='编辑企业公告'">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="创建人">
|
|
|
+ <a-input
|
|
|
+ v-decorator="['createBy', { rules: [{ required: false, message: '请输入创建人' }] }]"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="创建日期">
|
|
|
+ <a-date-picker
|
|
|
+ disabled
|
|
|
+ style="width:100%"
|
|
|
+ showTime
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ @change="createTimeChange"
|
|
|
+ @ok="createTimeOk"
|
|
|
+ v-decorator="['createTime', { rules: [{ required: false, message: '请选择紧创建日期' }] }]"
|
|
|
+ />
|
|
|
+
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
<!-- 公告富文本 -->
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
@@ -77,7 +110,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// import moment from 'moment'
|
|
|
+import moment from 'moment'
|
|
|
import 'moment/locale/zh-cn'
|
|
|
import JEditor from '@/components/jeecg/JEditor'
|
|
|
import { enterpriseEAdd, enterpriseEUpdate } from '@api/oa/cd-enterprise-announcement'
|
|
@@ -108,17 +141,29 @@ export default {
|
|
|
methods: {
|
|
|
// 回显表单
|
|
|
getAnnFormInfo (e) {
|
|
|
- console.log('弹框拿到编辑项ID', this.annInfo.id)
|
|
|
+ // console.log('弹框拿到编辑项ID', this.annInfo.id)
|
|
|
this.$nextTick(() => {
|
|
|
- this.addAnnForm.setFieldsValue({
|
|
|
- title: this.annInfo.title,
|
|
|
- type: this.annInfo.type,
|
|
|
- isRelease: this.isRelease
|
|
|
- })
|
|
|
+ if (this.title == '新增企业公告') {
|
|
|
+ this.addAnnForm.setFieldsValue({
|
|
|
+ title: this.annInfo.title,
|
|
|
+ type: this.annInfo.type,
|
|
|
+ isRelease: this.isRelease
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.addAnnForm.setFieldsValue({
|
|
|
+ title: this.annInfo.title,
|
|
|
+ type: this.annInfo.type,
|
|
|
+ isRelease: this.isRelease,
|
|
|
+ createBy: this.annInfo.createBy,
|
|
|
+ createTime: moment(this.annInfo.createTime, 'YYYY-MM-DD HH:mm:ss')
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
this.$refs.JEditor.myValue = this.annInfo.content
|
|
|
- console.log('回显完成,保存按钮判断是否编辑')
|
|
|
+ // console.log('回显完成,保存按钮判断是否编辑')
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
// 弹框 保存
|
|
|
handleOk () {
|
|
|
this.addAnnForm.validateFields((err, vals) => {
|
|
@@ -127,17 +172,17 @@ export default {
|
|
|
news.title = vals.title
|
|
|
news.type = vals.type
|
|
|
news.createBy = vals.createBy
|
|
|
- news.createTime = vals.createTime
|
|
|
+ news.createTime = vals.createTime.format('YYYY-MM-DD HH:mm:ss')
|
|
|
news.isRelease = vals.isRelease
|
|
|
news.content = this.$refs.JEditor.myValue
|
|
|
- // console.log(news.content )
|
|
|
// 编辑--------------------------------------
|
|
|
if (this.annInfo.id) {
|
|
|
news.id = this.annInfo.id
|
|
|
+ // console.log('>>>>>', this.annInfo.createTime)
|
|
|
console.log('这是修改')
|
|
|
enterpriseEUpdate(news).then(res => {
|
|
|
if (res.success) {
|
|
|
- this.$message.success('日程计划修改成功')
|
|
|
+ this.$message.success('修改成功')
|
|
|
this.addModalVisible = false
|
|
|
this.addAnnForm.resetFields() // 清空表单
|
|
|
this.$refs.JEditor.myValue = '' // 清空富文本
|
|
@@ -150,7 +195,7 @@ export default {
|
|
|
if (res.success) {
|
|
|
// console.log(res)
|
|
|
this.addModalVisible = false
|
|
|
- this.$message.success('新增企业公告成功')
|
|
|
+ this.$message.success('新增成功')
|
|
|
this.addAnnForm.resetFields() // 清空
|
|
|
this.$refs.JEditor.myValue = '' // 清空富文本
|
|
|
this.fatherGetList()
|