|
@@ -0,0 +1,645 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
+ label-width="150px">
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="客户名称" prop="clientName" :rules="[
|
|
|
+ {required: true, message:'请输入客户名称', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.clientName" placeholder="请输入客户名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-popover
|
|
|
+ v-model="visable"
|
|
|
+ placement="left"
|
|
|
+ width="400"
|
|
|
+ height="800"
|
|
|
+ trigger="click"
|
|
|
+ :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
|
|
|
+ ref="pops">
|
|
|
+ <vxe-table
|
|
|
+ border="inner"
|
|
|
+ auto-resize
|
|
|
+ resizable
|
|
|
+ :row-config="{isHover: true}"
|
|
|
+ :data="gridData"
|
|
|
+ :checkbox-config="{}"
|
|
|
+ :row-style="rowStyle"
|
|
|
+ @cell-click="rowClick"
|
|
|
+ :show-header="false"
|
|
|
+ >
|
|
|
+ <vxe-column title="" field="entname" ></vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ <el-button type="info" slot="reference" @click="getPopTable" style="width: 100%" plain>查询</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <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-row>
|
|
|
+
|
|
|
+ <el-row :gutter="15">
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="签订日期" prop="contractDate"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入签订日期', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="inputForm.contractDate"
|
|
|
+ type="date"
|
|
|
+ style="width: 418px"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同生效日期" prop="effectiveDate"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入合同生效日期', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="inputForm.effectiveDate"
|
|
|
+ type="date"
|
|
|
+ style="width: 418px"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同终止日期" prop="closingDate"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择合同终止日期', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="inputForm.closingDate"
|
|
|
+ type="date"
|
|
|
+ style="width: 418px"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同类型" prop="contractType"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择合同类型', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-select v-model="inputForm.contractType" placeholder="请选择" style="width:100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $dictUtils.getDictList('contract_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="contractAmountType"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择合同金额类别', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-radio-group v-model="inputForm.contractAmountType">
|
|
|
+ <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同/预计金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入合同/预计金额(元)', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.contractAmount" placeholder="请输入合同/预计金额(元)"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="对方合同编号" prop="contractOpposite">
|
|
|
+ <el-input v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="收费标准" prop="contractFees">
|
|
|
+ <el-checkbox-group v-model="inputForm.contractFees">
|
|
|
+ <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.label" >{{item.label}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="contractFee">
|
|
|
+ <el-input style="width: 500px" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row></el-row>
|
|
|
+
|
|
|
+ <el-form-item label="描述内容" prop="describes">
|
|
|
+ <el-input v-model="inputForm.describes"
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ placeholder="请输入描述内容"
|
|
|
+ show-word-limit>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="合同特别条款" prop="contractSpecial">
|
|
|
+ <el-input v-model="inputForm.contractSpecial"
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ placeholder="请输入合同特别条款"
|
|
|
+ show-word-limit>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="备注" prop="remarks">
|
|
|
+ <el-input v-model="inputForm.remarks"
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ placeholder="请输入合同备注"
|
|
|
+ show-word-limit>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i> 合同附件信息</el-divider>
|
|
|
+ <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"
|
|
|
+ :on-progress="uploadVideoProcess"
|
|
|
+ :file-list="filesArra2">
|
|
|
+ <el-button type="info" size="mini">点击上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <div style="height: calc(100% - 80px);margin-top: 10px">
|
|
|
+ <!-- 进度条 -->
|
|
|
+ <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>
|
|
|
+ <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" @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"/>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import WorkContractService from '@/api/sys/WorkContractService'
|
|
|
+ import WorkClientService from '@/api/sys/WorkClientService'
|
|
|
+ import OSSSerive, {
|
|
|
+ httpRequest,
|
|
|
+ toHref,
|
|
|
+ openWindowOnUrl,
|
|
|
+ handleRemove,
|
|
|
+ fileName
|
|
|
+ } from '@/api/sys/OSSService'
|
|
|
+ import moment from 'moment'
|
|
|
+ import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ visable: false,
|
|
|
+ gridData: [],
|
|
|
+ radio: 0,
|
|
|
+ tableData: [],
|
|
|
+ dataList: [],
|
|
|
+ dataListNew: [],
|
|
|
+ title: '',
|
|
|
+ method: '',
|
|
|
+ isSubmit: false,
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ returnForm: {
|
|
|
+ clientId: '',
|
|
|
+ name: '',
|
|
|
+ contractDate: '',
|
|
|
+ effectiveDate: '',
|
|
|
+ closingDate: '',
|
|
|
+ contractType: '',
|
|
|
+ contractAmountType: '',
|
|
|
+ contractAmount: '',
|
|
|
+ contractOpposite: '',
|
|
|
+ contractFees: [],
|
|
|
+ contractFee: '',
|
|
|
+ describes: '',
|
|
|
+ contractSpecial: '',
|
|
|
+ remarks: '',
|
|
|
+ clientName: ''
|
|
|
+ },
|
|
|
+ inputForm: {
|
|
|
+ clientId: '',
|
|
|
+ name: '',
|
|
|
+ contractDate: '',
|
|
|
+ effectiveDate: '',
|
|
|
+ closingDate: '',
|
|
|
+ contractType: '',
|
|
|
+ contractAmountType: '',
|
|
|
+ contractAmount: '',
|
|
|
+ contractOpposite: '',
|
|
|
+ contractFees: [],
|
|
|
+ contractFee: '',
|
|
|
+ describes: '',
|
|
|
+ contractSpecial: '',
|
|
|
+ remarks: '',
|
|
|
+ clientName: '',
|
|
|
+ permissionFlag: '',
|
|
|
+ showVi: true,
|
|
|
+ workAttachmentList: []
|
|
|
+ },
|
|
|
+ filesArra2: [],
|
|
|
+ fileList: [],
|
|
|
+ isFlag: true,
|
|
|
+ showViewer: false, // 显示查看器
|
|
|
+ url: '',
|
|
|
+ rowurl: '',
|
|
|
+ src: '',
|
|
|
+ onedit: false,
|
|
|
+ type: '',
|
|
|
+ loadProgress: 0, // 动态显示进度条
|
|
|
+ progressFlag: false, // 关闭进度条
|
|
|
+ promi: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ ElImageViewer
|
|
|
+ },
|
|
|
+ ossService: null,
|
|
|
+ workContractService: null,
|
|
|
+ workClientService: null,
|
|
|
+ created () {
|
|
|
+ this.ossService = new OSSSerive()
|
|
|
+ this.workContractService = new WorkContractService()
|
|
|
+ this.workClientService = new WorkClientService()
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ window.onPreview = this.onPreview
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ uploadVideoProcess (event, file, fileList) {
|
|
|
+ this.progressFlag = true // 显示进度条
|
|
|
+ this.loadProgress = parseInt(event.percent) // 动态获取文件上传进度
|
|
|
+ if (this.loadProgress >= 100) {
|
|
|
+ this.loadProgress = 100
|
|
|
+ setTimeout(() => { this.progressFlag = false }, 1000) // 一秒后关闭进度条
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async toHref (row) {
|
|
|
+ toHref(row)
|
|
|
+ },
|
|
|
+ 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 = {
|
|
|
+ clientId: '',
|
|
|
+ name: '',
|
|
|
+ contractDate: '',
|
|
|
+ effectiveDate: '',
|
|
|
+ closingDate: '',
|
|
|
+ contractType: '',
|
|
|
+ contractAmountType: '',
|
|
|
+ contractAmount: '',
|
|
|
+ contractOpposite: '',
|
|
|
+ contractFees: [],
|
|
|
+ contractFee: '',
|
|
|
+ describes: '',
|
|
|
+ contractSpecial: '',
|
|
|
+ remarks: '',
|
|
|
+ clientName: '',
|
|
|
+ filesArra2: [],
|
|
|
+ fileList: [],
|
|
|
+ isFlag: true,
|
|
|
+ showViewer: false, // 显示查看器
|
|
|
+ url: '',
|
|
|
+ rowurl: '',
|
|
|
+ src: '',
|
|
|
+ showVi: true,
|
|
|
+ type: '',
|
|
|
+ permissionFlag: '',
|
|
|
+ workAttachmentList: []
|
|
|
+ }
|
|
|
+ this.inputForm.id = id
|
|
|
+ if (method === 'add') {
|
|
|
+ this.inputForm.contractAmountType = '1'
|
|
|
+ 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.workContractService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ this.inputForm = this.recover(this.inputForm, data)
|
|
|
+ this.inputForm.contractFees = []
|
|
|
+ this.inputForm.permissionFlag = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ async saveForm1 () {
|
|
|
+ this.$refs['inputForm'].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.inputForm.workAttachmentList = []
|
|
|
+ this.dataListNew.forEach((item) => {
|
|
|
+ if (item.id === null || item.id === undefined || item.id === '') {
|
|
|
+ item.url = item.raw.url
|
|
|
+ }
|
|
|
+ item.attachmentFlag = 'workContract'
|
|
|
+ item.fileSize = item.size
|
|
|
+ item.attachmentName = item.name
|
|
|
+ this.inputForm.workAttachmentList.push(item)
|
|
|
+ })
|
|
|
+ let _p = null
|
|
|
+ await this.workContractService.save(this.inputForm).then(({data}) => {
|
|
|
+ this.loading = false
|
|
|
+ _p = new Promise((resolve, reject) => {
|
|
|
+ resolve({
|
|
|
+ 'businessTable': data.businessTable,
|
|
|
+ 'businessId': data.businessId,
|
|
|
+ 'inputForm': this.inputForm
|
|
|
+ })
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ return _p
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveForm (callback) {
|
|
|
+ this.$refs['inputForm'].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.inputForm.workAttachmentList = []
|
|
|
+ this.dataListNew.forEach((item) => {
|
|
|
+ if (item.id === null || item.id === undefined || item.id === '') {
|
|
|
+ item.url = item.raw.url
|
|
|
+ }
|
|
|
+ item.attachmentFlag = 'workContract'
|
|
|
+ item.fileSize = item.size
|
|
|
+ item.attachmentName = item.name
|
|
|
+ this.inputForm.workAttachmentList.push(item)
|
|
|
+ })
|
|
|
+ await this.workContractService.save(this.inputForm).then(({data}) => {
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close () {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.visible = false
|
|
|
+ this.showVi = true
|
|
|
+ },
|
|
|
+ httpRequest (file) {
|
|
|
+ httpRequest(file, fileName(file), 'workContract')
|
|
|
+ },
|
|
|
+ handleRemove () {
|
|
|
+ this.fileList = handleRemove()
|
|
|
+ },
|
|
|
+ changes (file, 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)
|
|
|
+ })
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 300
|
|
|
+ if (isLt2M === false) {
|
|
|
+ this.$message.error('文件大小不能超过 ' + 300 + 'M !')
|
|
|
+ this.fileList = []
|
|
|
+ this.filesArra2 = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async showFile (row) {
|
|
|
+ await openWindowOnUrl(row)
|
|
|
+ },
|
|
|
+ // 排序
|
|
|
+ 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) {
|
|
|
+ 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) {
|
|
|
+ this.radio = val.index
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭窗口时调用
|
|
|
+ closeXTable () {
|
|
|
+ this.closePop()
|
|
|
+ },
|
|
|
+ rowStyle (event) {
|
|
|
+ return 'cursor:pointer;'
|
|
|
+ },
|
|
|
+ async rowClick (event) {
|
|
|
+ let id = this.gridData[event.rowIndex].companyid
|
|
|
+ this.inputForm.clientId = id
|
|
|
+ await this.workClientService.enterpriseTicketInfo(id).then((data) => {
|
|
|
+ this.inputForm.clientName = data.data.ENTNAME
|
|
|
+ })
|
|
|
+ this.visable = false
|
|
|
+ },
|
|
|
+ async getPopTable () {
|
|
|
+ let name = this.inputForm.clientName
|
|
|
+ if (name !== null && name !== undefined && name !== '') {
|
|
|
+ await this.workClientService.enterpriseSearchByName(name).then(({data}) => {
|
|
|
+ this.gridData = data.data.items
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$refs.pops.updatePopper()
|
|
|
+ },
|
|
|
+ closePop () {
|
|
|
+ this.visable = false
|
|
|
+ },
|
|
|
+ changeContractFee () {
|
|
|
+ let fee = ''
|
|
|
+ let fees = this.inputForm.contractFees
|
|
|
+ if (fees.length > 0) {
|
|
|
+ fees.forEach(i => {
|
|
|
+ fee = fee + ';' + i
|
|
|
+ this.inputForm.contractFee = fee.substring(1, fee.length)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .tid_40 .vxe-body--column .vxe-cell{
|
|
|
+ padding: 1px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .tid_40 .vxe-header--row .col--last{
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .tid_45 .vxe-body--column .vxe-cell{
|
|
|
+ padding: 1px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .tid_45 .vxe-header--row .col--last{
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .avatar{
|
|
|
+ height: 100px;
|
|
|
+ }
|
|
|
+ .el-divider__text {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+</style>
|