|
@@ -4,77 +4,119 @@
|
|
|
:title="title"
|
|
|
:close-on-click-modal="false"
|
|
|
v-dialogDrag
|
|
|
- :visible.sync="visible">
|
|
|
+ :visible.sync="visible"
|
|
|
+ width='70%'>
|
|
|
<el-form :model="inputForm" size="small" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
label-width="120px">
|
|
|
<el-row :gutter="15">
|
|
|
+
|
|
|
+<!-- 政策标题、政策类型、政策级别、发布人、发布日期、政策内容 -->
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="企业" prop="qyId"
|
|
|
+ <el-form-item label="政策标题" prop="des1"
|
|
|
:rules="[
|
|
|
- {required: true, message:'企业不能为空', trigger:'blur'}
|
|
|
+ {required: true, message:'政策标题不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <qy-select :limit='1' :value="inputForm.qyId" @getValue='(value) => {inputForm.qyId=value}'></qy-select>
|
|
|
+ <el-input v-model="inputForm.des1" placeholder="请填写政策标题" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="开始时间" prop="stime"
|
|
|
+ <el-form-item label="政策发文日期" prop="stime"
|
|
|
:rules="[
|
|
|
- {required: true, message:'开始时间不能为空', trigger:'blur'}
|
|
|
+ {required: true, message:'政策发文日期不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
<el-date-picker
|
|
|
style="width: 100%;"
|
|
|
v-model="inputForm.stime"
|
|
|
- type="datetime"
|
|
|
+ type="date"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="选择日期时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="结束时间" prop="etime"
|
|
|
+ <el-form-item label="政策类型" prop="des2"
|
|
|
:rules="[
|
|
|
- {required: true, message:'结束时间不能为空', trigger:'blur'}
|
|
|
+ {required: true, message:'政策类型不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-date-picker
|
|
|
- style="width: 100%;"
|
|
|
- v-model="inputForm.etime"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择日期时间">
|
|
|
- </el-date-picker>
|
|
|
+ <el-select v-model="inputForm.des2" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('sys_zclx')"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="金额" prop="amount"
|
|
|
+ <el-form-item label="政策级别" prop="des3"
|
|
|
:rules="[
|
|
|
- {required: true, message:'金额不能为空', trigger:'blur'}
|
|
|
+ {required: true, message:'政策级别不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-input v-model="inputForm.amount" placeholder="请填写金额" ></el-input>
|
|
|
+ <el-select v-model="inputForm.des3" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('sys_zcjb')"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="用电量" prop="degrees"
|
|
|
+
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="政策内容" prop="content"
|
|
|
:rules="[
|
|
|
- {required: true, message:'用电量不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-input v-model="inputForm.degrees" placeholder="请填写用电量" ></el-input>
|
|
|
+ <WangEditor ref="contentEditor" v-model="inputForm.des4"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="是否缴费" prop="isPay"
|
|
|
+
|
|
|
+ <!-- <el-col :span="24">
|
|
|
+ <el-form-item label="图片" prop="des5"
|
|
|
:rules="[
|
|
|
- {required: true, message:'是否缴费不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-select v-model="inputForm.isPay" placeholder="请选择" style="width: 100%;">
|
|
|
- <el-option
|
|
|
- v-for="item in $dictUtils.getDictList('yes_no')"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-upload ref="img"
|
|
|
+ v-if="visible"
|
|
|
+ list-type="picture-card"
|
|
|
+ :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/qy/product/product`"
|
|
|
+ :headers="{token: $cookie.get('token')}"
|
|
|
+ :on-preview="(file, fileList) => {
|
|
|
+ $alert(`<img style='width:100%' src=' ${(file.response && file.response.url) || file.url}'/>`, {
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ showConfirmButton: false,
|
|
|
+ closeOnClickModal: true,
|
|
|
+ customClass: 'showPic'
|
|
|
+ });
|
|
|
+ }"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-success="(response, file, fileList) => {
|
|
|
+ inputForm.img = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
|
|
|
+ }"
|
|
|
+ :on-remove="(file, fileList) => {
|
|
|
+ $http.delete(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
|
|
|
+ $message.success(data)
|
|
|
+ })
|
|
|
+ inputForm.img = fileList.map(item => item.url).join('|')
|
|
|
+ }"
|
|
|
+ :before-remove="(file, fileList) => {
|
|
|
+ return $confirm(`确定移除 ${file.name}?`)
|
|
|
+ }"
|
|
|
+ multiple
|
|
|
+ :limit="5"
|
|
|
+ :on-exceed="(files, fileList) =>{
|
|
|
+ $message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
+ }"
|
|
|
+ :file-list="imgArra">
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ </el-upload>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
+
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -87,6 +129,7 @@
|
|
|
|
|
|
<script>
|
|
|
import QySelect from '@/components/qySelect'
|
|
|
+ import WangEditor from '@/components/editor/WangEditor'
|
|
|
import enterpriseElectricityService from '@/api/enterpriseelectricity/enterpriseElectricityService'
|
|
|
export default {
|
|
|
data () {
|
|
@@ -97,37 +140,43 @@
|
|
|
loading: false,
|
|
|
inputForm: {
|
|
|
id: '',
|
|
|
- qyId: '',
|
|
|
stime: '',
|
|
|
- etime: '',
|
|
|
- amount: '',
|
|
|
- degrees: '',
|
|
|
- isPay: ''
|
|
|
+
|
|
|
+ des1: '',
|
|
|
+ des2: '',
|
|
|
+ des3: '',
|
|
|
+ des4: '',
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- QySelect
|
|
|
+ QySelect,
|
|
|
+ WangEditor
|
|
|
},
|
|
|
methods: {
|
|
|
init (method, id) {
|
|
|
this.method = method
|
|
|
this.inputForm.id = id
|
|
|
if (method === 'add') {
|
|
|
- this.title = `新建企业电费`
|
|
|
+ this.title = `发布涉企政策`
|
|
|
} else if (method === 'edit') {
|
|
|
- this.title = '修改企业电费'
|
|
|
+ this.title = '修改涉企政策'
|
|
|
} else if (method === 'view') {
|
|
|
- this.title = '查看企业电费'
|
|
|
+ this.title = '查看涉企政策'
|
|
|
}
|
|
|
this.visible = true
|
|
|
this.loading = false
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
+ this.$refs.contentEditor.init('')
|
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
this.loading = true
|
|
|
enterpriseElectricityService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ //data.stime=data.stime.substring(0,10)
|
|
|
+ data.stime=data.stime+" 00:00:00"
|
|
|
+ console.log(data.stime)
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
+ this.$refs.contentEditor.init(this.inputForm.des4)
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|