|
@@ -0,0 +1,185 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ :title="!id ? '发布': display ? '详情' : '修改'"
|
|
|
+ width="70%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :visible.sync="visible">
|
|
|
+ <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="公告主题名称">
|
|
|
+ <el-input v-model="dataForm.title" :disabled="display" placeholder="请输入公告主题名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="padding-left: 20px">
|
|
|
+ <el-form-item label="级别" prop="level">
|
|
|
+ <el-select
|
|
|
+ v-model="dataForm.level"
|
|
|
+ :disabled="display"
|
|
|
+ remote
|
|
|
+ placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionLevel"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.code">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户名称" prop="name">
|
|
|
+ <el-input v-model="dataForm.name" disabled placeholder="客户名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="padding-left: 20px">
|
|
|
+ <el-form-item label="联系人" prop="cellName">
|
|
|
+ <el-input v-model="dataForm.cellName" disabled placeholder="联系人"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-form-item label="备注说明">
|
|
|
+ <el-input v-model="dataForm.notes" :disabled="display" placeholder="备注说明"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <div class="title">沟通信息表附件</div>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <div class="title"><span style="color: red">*</span> 合同评审表</div>
|
|
|
+ <el-upload
|
|
|
+ v-show="!display"
|
|
|
+ class="upload-demo"
|
|
|
+ ref="upload"
|
|
|
+ action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :file-list="fileList"
|
|
|
+ :auto-upload="false">
|
|
|
+ <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
|
|
+ <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">开始上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="visible = false">取消</el-button>
|
|
|
+ <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { getcoCode, getReviewType, getreDetail } from '@/api/cus'
|
|
|
+ export default {
|
|
|
+ name: 'notice-add-or-update',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ dictType: 'material_type',
|
|
|
+ options: [],
|
|
|
+ options1: [],
|
|
|
+ dataList: [],
|
|
|
+ fileList: [],
|
|
|
+ id: 0,
|
|
|
+ dataForm: {
|
|
|
+ coCode: '',
|
|
|
+ name: '',
|
|
|
+ cellName: '',
|
|
|
+ reType: '',
|
|
|
+ notes: '',
|
|
|
+ attachList: []
|
|
|
+ },
|
|
|
+ dataRule: {
|
|
|
+ coCode: [{ required: true, message: '沟通编码不能为空', trigger: 'change' }],
|
|
|
+ reType: [{ required: true, message: '评审类别不能为空', trigger: 'change' }],
|
|
|
+ name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
|
|
|
+ cellName: [{ required: true, message: '联系人不能为空', trigger: 'blur' }]
|
|
|
+ },
|
|
|
+ display: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'dataForm.coCode' (value) {
|
|
|
+ this.options1.forEach(v => {
|
|
|
+ if (v.customerId === value) {
|
|
|
+ this.dataForm.name = v.customerName
|
|
|
+ this.dataForm.cellName = v.contact
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async init (id, disabled) {
|
|
|
+ this.visible = true
|
|
|
+ this.id = id || 0
|
|
|
+ await getReviewType().then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.options = data.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ await getcoCode().then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.options1 = data.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (!id) return
|
|
|
+ await getreDetail().then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataForm = data.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submitUpload () {
|
|
|
+ this.$refs.upload.submit()
|
|
|
+ },
|
|
|
+ handleRemove (file, fileList) {
|
|
|
+ console.log(file, fileList)
|
|
|
+ },
|
|
|
+ handlePreview (file) {
|
|
|
+ console.log(file)
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ dataFormSubmit () {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/flow/cusContractReview/submit`),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData(this.dataForm)
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.visible = false
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ validateField (type) {
|
|
|
+ this.$refs.dataForm.validateField(type)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.my-line{
|
|
|
+ border-bottom: 1px solid #c0c4cc;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+.title{
|
|
|
+ padding: 10px 0 ;
|
|
|
+}
|
|
|
+</style>
|