|
@@ -0,0 +1,780 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ v-dialogDrag
|
|
|
+ width="800px"
|
|
|
+ @close="close,closeXTable"
|
|
|
+ @keyup.enter.native="doSubmit"
|
|
|
+ :visible.sync="visible">
|
|
|
+ <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
+ label-width="150px">
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户名称" prop="name"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入客户名称', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.name" placeholder="请输入客户名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="是否拥有信用代码" prop="hasUscc"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择是否拥有信用代码', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-radio-group v-model="inputForm.hasUscc">
|
|
|
+ <el-radio v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="统一社会信用代码" prop="uscCode" v-if="inputForm.hasUscc === '1'"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入统一社会信用代码', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.uscCode" placeholder="请输入统一社会信用代码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户性质" prop="companyType"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择客户性质', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-select v-model="inputForm.companyType" placeholder="请选择" style="width:100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('customer_nature')"
|
|
|
+ :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="companyIndustry"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择所在行业', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-select v-model="inputForm.companyIndustry" placeholder="请选择" style="width:100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('industry')"
|
|
|
+ :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="clientType"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择客户类型', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-select v-model="inputForm.clientType" placeholder="请选择" style="width:100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('customer_type')"
|
|
|
+ :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="deputy"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择代表方', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-select v-model="inputForm.deputy" placeholder="请选择" multiple style="width:100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('representative')"
|
|
|
+ :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="lawerPresint">
|
|
|
+ <el-input v-model="inputForm.lawerPresint" placeholder="请填写法人代表"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="邮政编码" prop="zipCode">
|
|
|
+ <el-input v-model="inputForm.zipCode" placeholder="请填写邮政编码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="传真" prop="fax">
|
|
|
+ <el-input v-model="inputForm.fax" placeholder="请填写传真"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="公司电话" prop="telephone"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请填写公司电话', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.telephone" placeholder="请填写公司电话"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="公司网址" prop="companyUrl">
|
|
|
+ <el-input v-model="inputForm.companyUrl" placeholder="请填写公司网址"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="归属区域" prop="areaId"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择归属区域', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <SelectTree
|
|
|
+ ref="areaTree"
|
|
|
+ :props="{
|
|
|
+ value: 'areaId', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+ url="/sys/area/treeData"
|
|
|
+ :value="inputForm.areaId"
|
|
|
+ :clearable="true"
|
|
|
+ :accordion="true"
|
|
|
+ v-if="visible"
|
|
|
+ @getValue="(value) => {inputForm.areaId=value}"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="注册地址" prop="registerAddress">
|
|
|
+ <el-input v-model="inputForm.registerAddress" placeholder="请填写注册地址"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="详细地址" prop="address">
|
|
|
+ <el-input v-model="inputForm.address" placeholder="请填写详细地址"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-form-item label="单位简介" prop="remarks">
|
|
|
+ <el-input v-model="inputForm.remarks"
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ maxlength="500"
|
|
|
+ placeholder="请输入单位简介"
|
|
|
+ show-word-limit>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="开户行信息" prop="bankInfos">
|
|
|
+ <vxe-toolbar>
|
|
|
+ <template #buttons>
|
|
|
+ <vxe-button size="mini" @click="insertEvent('bank')">新增</vxe-button>
|
|
|
+ </template>
|
|
|
+ </vxe-toolbar>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ show-overflow
|
|
|
+ ref="xTable1"
|
|
|
+ class="vxe-table-element"
|
|
|
+ height="200"
|
|
|
+ :data="bankInfos"
|
|
|
+ style="margin-left: 5em"
|
|
|
+ @cell-click="dbclickFun"
|
|
|
+ @edit-closed=""
|
|
|
+ highlight-current-row
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true}"
|
|
|
+ >
|
|
|
+
|
|
|
+ <vxe-table-column field="ourBank" title="开户银行" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope" >
|
|
|
+ <el-input v-model="scope.row.ourBank" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="bankNumber" title="开户账号" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope" >
|
|
|
+ <el-input v-model="scope.row.bankNumber" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="remarks" title="备注信息" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope" >
|
|
|
+ <el-input v-model="scope.row.remarks" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column label="操作" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'bank')">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <el-form-item label="联系人信息" prop="linkmanInfos">
|
|
|
+ <vxe-toolbar>
|
|
|
+ <template #buttons>
|
|
|
+ <vxe-button size="mini" @click="insertEvent('linkman')">新增</vxe-button>
|
|
|
+ </template>
|
|
|
+ </vxe-toolbar>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ show-overflow
|
|
|
+ ref="xTable2"
|
|
|
+ class="vxe-table-element"
|
|
|
+ height="200"
|
|
|
+ :data="linkmanInfos"
|
|
|
+ style="margin-left: 5em"
|
|
|
+ @cell-click="dbclickFun"
|
|
|
+ @edit-closed=""
|
|
|
+ highlight-current-row
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true}"
|
|
|
+ >
|
|
|
+
|
|
|
+ <vxe-table-column field="name" title="联系人姓名" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.name" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="office" title="部门" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.office" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="position" title="职务" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.position" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="qq" title="QQ" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.qq" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="linkPhone" title="联系方式1" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.linkPhone" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="linkMobile" title="联系方式2" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.linkMobile" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column field="email" title="E-mail" :edit-render="{type: 'default'}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.email" @input="$refs.xTable.updateStatus(scope)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column label="操作" width="100">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'linkman')">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+
|
|
|
+ <el-upload ref="upload" style="display: inline-block; margin-left: 5em; :show-header='status'" action=""
|
|
|
+ :limit="999" :http-request="httpRequest"
|
|
|
+ multiple
|
|
|
+ :on-exceed="(files, fileList) =>{
|
|
|
+ $message.warning(`当前限制选择 999 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
+ }"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-change="changes"
|
|
|
+ :file-list="filesArra2">
|
|
|
+ <el-button type="info" size="mini" v-if="inputForm.permissionFlag&&showVi">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <div style="height: calc(100% - 80px);margin-top: 30px">
|
|
|
+ <vxe-table
|
|
|
+ style="margin-left: 5em"
|
|
|
+ border="inner"
|
|
|
+ auto-resize
|
|
|
+ resizable
|
|
|
+ height="200px"
|
|
|
+ :loading="loading"
|
|
|
+ size="small"
|
|
|
+ ref="projectTable"
|
|
|
+ show-header-overflow
|
|
|
+ show-overflow
|
|
|
+ highlight-hover-row
|
|
|
+ :menu-config="{}"
|
|
|
+ :print-config="{}"
|
|
|
+ @sort-change="sortChangeHandle"
|
|
|
+ :sort-config="{remote:true}"
|
|
|
+ :data="dataListNew"
|
|
|
+ :checkbox-config="{}">
|
|
|
+ <vxe-column type="seq" width="40"></vxe-column>
|
|
|
+ <vxe-column title="文件名称" field="name">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.name}}</el-link>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column title="创建人" field="createBy"></vxe-column>
|
|
|
+ <vxe-column title="创建时间" field="createDate"></vxe-column>
|
|
|
+ <vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" icon="el-icon-delete" size="small" v-if="inputForm.permissionFlag&&showVi" @click="deleteMsgById(scope.row, scope.$rowIndex)">删除</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-image-viewer
|
|
|
+ v-if="showViewer"
|
|
|
+ :on-close="closeViewer"
|
|
|
+ :url-list="[url]"
|
|
|
+ zIndex="9999"/>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="close(),closeXTable()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
+ <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import WorkClientService from '@/api/sys/WorkClientService'
|
|
|
+ import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
+ import OSSSerive, {
|
|
|
+ httpRequest,
|
|
|
+ handleRemove,
|
|
|
+ fileName
|
|
|
+ } from '@/api/sys/OSSService'
|
|
|
+ import moment from 'moment'
|
|
|
+ import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ workClientInfo: '',
|
|
|
+ workClientBank: [],
|
|
|
+ workClientLinkman: [],
|
|
|
+ radio: 0,
|
|
|
+ tableData: [],
|
|
|
+ dataList: [],
|
|
|
+ dataListNew: [],
|
|
|
+ title: '',
|
|
|
+ method: '',
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ inputForm: {
|
|
|
+ permissionFlag: '', // 判断是否为当前登录人参数
|
|
|
+ name: '',
|
|
|
+ hasUscc: '',
|
|
|
+ uscCode: '',
|
|
|
+ companyType: '',
|
|
|
+ companyIndustry: '',
|
|
|
+ clientType: '',
|
|
|
+ deputy: '',
|
|
|
+ lawerPresint: '',
|
|
|
+ zipCode: '',
|
|
|
+ fax: '',
|
|
|
+ telephone: '',
|
|
|
+ companyUrl: '',
|
|
|
+ areaId: '',
|
|
|
+ registerAddress: '',
|
|
|
+ address: ''
|
|
|
+ },
|
|
|
+ bankInfos: [],
|
|
|
+ bankInfo: {
|
|
|
+ ourBank: '',
|
|
|
+ bankNumber: '',
|
|
|
+ remarks: ''
|
|
|
+ },
|
|
|
+ linkmanInfos: [],
|
|
|
+ linkmanInfo: {
|
|
|
+ name: '',
|
|
|
+ office: '',
|
|
|
+ position: '',
|
|
|
+ qq: '',
|
|
|
+ linkPhone: '',
|
|
|
+ linkMobile: '',
|
|
|
+ email: ''
|
|
|
+ },
|
|
|
+ filesArra2: [],
|
|
|
+ fileList: [],
|
|
|
+ isFlag: true,
|
|
|
+ showViewer: false, // 显示查看器
|
|
|
+ url: '',
|
|
|
+ rowurl: '',
|
|
|
+ src: '',
|
|
|
+ showVi: true,
|
|
|
+ onedit: false,
|
|
|
+ type: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ ElImageViewer,
|
|
|
+ SelectTree
|
|
|
+ },
|
|
|
+ ossService: null,
|
|
|
+ workClientService: null,
|
|
|
+ created () {
|
|
|
+ this.ossService = new OSSSerive()
|
|
|
+ this.workClientService = new WorkClientService()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async toHref (row) {
|
|
|
+ const link = document.createElement('a')
|
|
|
+ if (row.id === null || row.id === undefined || row.id === '') {
|
|
|
+ await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
+ const url = data.data // 完整的url则直接使用
|
|
|
+ // 这里是将url转成blob地址,
|
|
|
+ fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
|
|
|
+ link.href = URL.createObjectURL(blob)
|
|
|
+ console.log(link.href)
|
|
|
+ link.download = row.name || '' // 下载文件的名字
|
|
|
+ // a.download = url.split('/')[url.split('/').length -1] // // 下载文件的名字
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ // 在资源下载完成后 清除 占用的缓存资源
|
|
|
+ window.URL.revokeObjectURL(link.href)
|
|
|
+ document.body.removeChild(link)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const url = row.temporaryUrl // 完整的url则直接使用
|
|
|
+ // 这里是将url转成blob地址,
|
|
|
+ fetch(url).then(res => res.blob()).then(blob => { // 将链接地址字符内容转变成blob地址
|
|
|
+ link.href = URL.createObjectURL(blob)
|
|
|
+ console.log(link.href)
|
|
|
+ link.download = row.name || '' // 下载文件的名字
|
|
|
+ // a.download = url.split('/')[url.split('/').length -1] // // 下载文件的名字
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ // 在资源下载完成后 清除 占用的缓存资源
|
|
|
+ window.URL.revokeObjectURL(link.href)
|
|
|
+ document.body.removeChild(link)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onPreview (url) {
|
|
|
+ this.url = url
|
|
|
+ this.showViewer = true
|
|
|
+ },
|
|
|
+ // 关闭查看器
|
|
|
+ closeViewer () {
|
|
|
+ this.url = ''
|
|
|
+ this.showViewer = false
|
|
|
+ },
|
|
|
+ init (method, id) {
|
|
|
+ this.dataList = []
|
|
|
+ this.dataListNew = []
|
|
|
+ this.ossService.findFileList(id).then(({data}) => {
|
|
|
+ data.forEach((item) => {
|
|
|
+ item.name = item.attachmentName
|
|
|
+ this.dataList.push(item)
|
|
|
+ this.dataListNew.push(item)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.method = method
|
|
|
+ this.inputForm = {
|
|
|
+ name: '',
|
|
|
+ hasUscc: '',
|
|
|
+ uscCode: '',
|
|
|
+ companyType: '',
|
|
|
+ companyIndustry: '',
|
|
|
+ clientType: '',
|
|
|
+ deputy: '',
|
|
|
+ lawerPresint: '',
|
|
|
+ zipCode: '',
|
|
|
+ fax: '',
|
|
|
+ telephone: '',
|
|
|
+ companyUrl: '',
|
|
|
+ areaId: '',
|
|
|
+ registerAddress: '',
|
|
|
+ address: '',
|
|
|
+ bankInfos: [],
|
|
|
+ bankInfo: {
|
|
|
+ ourBank: '',
|
|
|
+ bankNumber: '',
|
|
|
+ remarks: ''
|
|
|
+ },
|
|
|
+ linkmanInfos: [],
|
|
|
+ linkmanInfo: {
|
|
|
+ name: '',
|
|
|
+ office: '',
|
|
|
+ position: '',
|
|
|
+ qq: '',
|
|
|
+ linkPhone: '',
|
|
|
+ linkMobile: '',
|
|
|
+ email: ''
|
|
|
+ },
|
|
|
+ filesArra2: [],
|
|
|
+ fileList: [],
|
|
|
+ isFlag: true,
|
|
|
+ showViewer: false, // 显示查看器
|
|
|
+ url: '',
|
|
|
+ rowurl: '',
|
|
|
+ src: '',
|
|
|
+ showVi: true,
|
|
|
+ type: ''
|
|
|
+ }
|
|
|
+ this.inputForm.id = id
|
|
|
+ if (method === 'add') {
|
|
|
+ this.inputForm.hasUscc = '1'
|
|
|
+ this.inputForm.permissionFlag = true
|
|
|
+ this.title = `新建客户信息`
|
|
|
+ } else if (method === 'edit') {
|
|
|
+ this.title = '修改客户信息'
|
|
|
+ } else if (method === 'view') {
|
|
|
+ this.showVi = false
|
|
|
+ this.title = '查看客户详情'
|
|
|
+ }
|
|
|
+ this.visible = true
|
|
|
+ this.loading = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // this.$refs.upload.clearFiles()
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
+ this.loading = true
|
|
|
+ this.workClientService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ this.inputForm = this.recover(this.inputForm, data)
|
|
|
+ data.workClientBank.forEach(i => {
|
|
|
+ this.bankInfos.push(i)
|
|
|
+ })
|
|
|
+ data.workClientLinkman.forEach(i => {
|
|
|
+ this.linkmanInfos.push(i)
|
|
|
+ })
|
|
|
+ this.inputForm = data.workClientInfo
|
|
|
+ this.inputForm.permissionFlag = data.permissionFlag
|
|
|
+ this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ doSubmit () {
|
|
|
+ this.$refs['inputForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.inputForm.itemType = '1'
|
|
|
+ console.log(this.dataListNew)
|
|
|
+ this.inputForm.workAttachments = []
|
|
|
+ this.dataListNew.forEach((item) => {
|
|
|
+ if (item.id === null || item.id === undefined || item.id === '') {
|
|
|
+ item.url = item.raw.url
|
|
|
+ }
|
|
|
+ item.attachmentFlag = 'projectRecords'
|
|
|
+ item.fileSize = item.size
|
|
|
+ item.attachmentName = item.name
|
|
|
+ this.inputForm.workAttachments.push(item)
|
|
|
+ })
|
|
|
+ if (this.inputForm.evaluationReportDateUi === null || this.inputForm.evaluationReportDateUi === undefined || this.inputForm.evaluationReportDateUi === '') {
|
|
|
+ this.inputForm.status = '1'
|
|
|
+ } else {
|
|
|
+ this.inputForm.status = '5'
|
|
|
+ }
|
|
|
+ this.projectService.save(this.inputForm).then(({data}) => {
|
|
|
+ this.close()
|
|
|
+ this.$message.success(data)
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close () {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.visible = false
|
|
|
+ this.showVi = true
|
|
|
+ },
|
|
|
+ httpRequest (file) {
|
|
|
+ httpRequest(file, fileName(file), 'projectRecords')
|
|
|
+ },
|
|
|
+ handleRemove () {
|
|
|
+ this.fileList = handleRemove()
|
|
|
+ },
|
|
|
+ changes (file, fileList) {
|
|
|
+ console.log('file', file)
|
|
|
+ console.log('22', fileList)
|
|
|
+ this.dataListNew = []
|
|
|
+ this.dataList.forEach((item) => {
|
|
|
+ this.dataListNew.push(item)
|
|
|
+ })
|
|
|
+ fileList.forEach((item) => {
|
|
|
+ item.createDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ item.createBy = this.$store.state.user.name
|
|
|
+ this.dataListNew.push(item)
|
|
|
+ })
|
|
|
+ console.log('11', this.dataList)
|
|
|
+ console.log('33', this.dataListNew)
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 300
|
|
|
+ if (isLt2M === false) {
|
|
|
+ this.$message.error('文件大小不能超过 ' + 300 + 'M !')
|
|
|
+ this.fileList = []
|
|
|
+ this.filesArra2 = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async showFile (row) {
|
|
|
+ console.log('row', row)
|
|
|
+ let suffix = row.name.substring(row.name.lastIndexOf('.') + 1)
|
|
|
+ if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
|
|
|
+ if (row.url !== null && row.url !== undefined && row.url !== '') {
|
|
|
+ this.onPreview(row.url)
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
+ this.onPreview(data.data)
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (row.url !== null && row.url !== undefined && row.url !== '') {
|
|
|
+ if (suffix === 'pdf') {
|
|
|
+ window.open('https://view.xdocin.com/xdoc?_xdoc=' + row.url, '_blank')
|
|
|
+ } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
|
|
|
+ window.open('http://ow365.cn/?i=25008&furl=' + row.url, '_blank')
|
|
|
+ } else {
|
|
|
+ window.open('https://view.officeapps.live.com/op/view.aspx?src=' + row.url, '_blank')
|
|
|
+ }
|
|
|
+ } else if (row.raw.url !== null && row.raw.url !== undefined && row.raw.url !== '') {
|
|
|
+ await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
+ this.rowurl = data.data
|
|
|
+ })
|
|
|
+ if (suffix === 'pdf') {
|
|
|
+ window.open('https://view.xdocin.com/xdoc?_xdoc=' + this.rowurl, '_blank')
|
|
|
+ } else if (suffix === 'rar' || suffix === 'zip' || suffix === 'jar' || suffix === '7z') {
|
|
|
+ window.open('http://ow365.cn/?i=25008&furl=' + this.rowurl, '_blank')
|
|
|
+ } else {
|
|
|
+ window.open('https://view.officeapps.live.com/op/view.aspx?src=' + this.rowurl, '_blank')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 排序
|
|
|
+ sortChangeHandle (column) {
|
|
|
+ this.orders = []
|
|
|
+ if (column.order != null) {
|
|
|
+ this.orders.push({column: this.$utils.toLine(column.prop), asc: column.order === 'ascending'})
|
|
|
+ }
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ deleteMsgById (row, index) {
|
|
|
+ console.log(index)
|
|
|
+ this.dataListNew.splice(index, 1)
|
|
|
+ if (row.id !== null && row.id !== '' && row.id !== undefined) {
|
|
|
+ this.ossService.deleteMsgById(row.id)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ twoDecimalPlaces (num) {
|
|
|
+ let str = num.toString()
|
|
|
+ var len1 = str.substr(0, 1)
|
|
|
+ var len2 = str.substr(1, 1)
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (str.length > 1 && len1 == 0 && len2 != '.') {
|
|
|
+ str = str.substr(1, 1)
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (len1 == '.') {
|
|
|
+ str = ''
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (str.indexOf('.') != -1) {
|
|
|
+ var str_ = str.substr(str.indexOf('.') + 1)
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (str_.indexOf('.') != -1) {
|
|
|
+ str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
|
|
|
+ }
|
|
|
+ if (str_.length > 4) {
|
|
|
+ this.$message.warning(`金额小数点后只能输入四位,请正确输入!`)
|
|
|
+ return (str = '')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-useless-escape
|
|
|
+ str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
|
+ return str
|
|
|
+ },
|
|
|
+ positiveInteger (num) {
|
|
|
+ let str = num.toString()
|
|
|
+ var len1 = str.substr(0, 1)
|
|
|
+ var len2 = str.substr(1, 1)
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (str.length > 1 && len1 == 0 && len2 != '.') {
|
|
|
+ str = str.substr(1, 1)
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (len1 == '.') {
|
|
|
+ str = ''
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-useless-escape
|
|
|
+ str = str.replace(/[^\d^]+/g, '') // 保留数字
|
|
|
+ return str
|
|
|
+ },
|
|
|
+ tableRowClassName ({row, rowIndex}) {
|
|
|
+ row.index = rowIndex
|
|
|
+ },
|
|
|
+ handleRadioChange (val) {
|
|
|
+ if (val) {
|
|
|
+ console.log(val)
|
|
|
+ this.radio = val.index
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ getAllFirm () {
|
|
|
+ this.rankSequenceService.queryAllFirm().then(({data}) => {
|
|
|
+ // 赋值的时候
|
|
|
+ this.bankInfo = JSON.parse(JSON.stringify(data))
|
|
|
+ this.bankInfos = JSON.parse(JSON.stringify(this.bankInfo))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 点击修改
|
|
|
+ dbclickFun (cell) {
|
|
|
+ console.log('firm', this.bankInfo)
|
|
|
+ this.onedit = false
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ removeEvent (row, rowIndex, type) {
|
|
|
+ if (type === 'bank') {
|
|
|
+ console.log('rowIndex', rowIndex)
|
|
|
+ this.$refs.xTable1.remove(row)
|
|
|
+ this.bankInfos.splice(rowIndex, 1)
|
|
|
+ }
|
|
|
+ if (type === 'linkman') {
|
|
|
+ console.log('rowIndex', rowIndex)
|
|
|
+ this.$refs.xTable2.remove(row)
|
|
|
+ this.linkmanInfos.splice(rowIndex, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ // eslint-disable-next-line no-dupe-keys
|
|
|
+ async insertEvent (type) {
|
|
|
+ if (type === 'bank') {
|
|
|
+ const {row: newRow} = await this.$refs.xTable1.insertAt()
|
|
|
+ this.bankInfos.push(newRow)
|
|
|
+ await this.$refs.xTable.setEditCell(newRow, 'ourBank')
|
|
|
+ }
|
|
|
+ if (type === 'linkman') {
|
|
|
+ const {row: newRow} = await this.$refs.xTable2.insertAt()
|
|
|
+ this.linkmanInfos.push(newRow)
|
|
|
+ await this.$refs.xTable.setEditCell(newRow, 'name')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭窗口时调用
|
|
|
+ closeXTable () {
|
|
|
+ this.bankInfos = []
|
|
|
+ this.linkmanInfos = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|