|
@@ -0,0 +1,996 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-form size="default" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
|
|
|
+ label-width="150px">
|
|
|
+
|
|
|
+ <el-divider v-if="(status === 'audit' || status === 'taskFormDetail'|| method==='view') && commonJS.isNotEmpty(inputForm.customerId)" content-position="left">
|
|
|
+ <el-link type="primary" :underline="false" icon="el-icon-document" @click="viewClient(inputForm.customerId)"><b>查看客户详情</b></el-link>
|
|
|
+ </el-divider>
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i> 客户信息</el-divider>
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="主委托方" prop="primaryLinkman"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message: '请选择委托方', trigger: 'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input :readonly="true" maxlength="100" @focus="openWorkClient2()" v-model="inputForm.primaryLinkman" placeholder="请选择委托方">
|
|
|
+ <!-- <el-button slot="append" icon="el-icon-search" @click="openWorkClient2()"></el-button>-->
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="客户编号" prop="customerNo"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input :readonly="true" v-model="inputForm.customerNo" placeholder="请填写客户编号" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="统一社会信用代码" prop="uscCode"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input :readonly="true" v-model="inputForm.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="委托方电话" prop="clientContactsPhone"
|
|
|
+ :rules="[
|
|
|
+ // {required: true, message: '委托方电话', trigger: 'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input maxlength="15" :readonly="true" v-model="inputForm.clientContactsPhone" placeholder="请输入委托方电话"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="地址" prop="address"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input :readonly="true" v-model="inputForm.address" placeholder="地址" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i> 基本信息</el-divider>
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同名称" prop="contractName"
|
|
|
+ :rules="[{required: true, message: '合同名称不能为空', trigger: 'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input :readonly="true" v-model="inputForm.contractName" placeholder="请输入合同名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同编号" prop="contractNo">
|
|
|
+ <el-input maxlength="64" :readonly="true" v-model="inputForm.contractNo" placeholder="自动生成"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同类型" prop="contractTypes"
|
|
|
+ :rules="[{required: true, message: '合同类型不能为空', trigger: 'blur'}
|
|
|
+ ]" >
|
|
|
+ <div style="width: 100%;" v-if="status==='edit'">
|
|
|
+ <el-cascader v-model="inputForm.contractTypes" :options="typeData" @change="handleChange" :props="{
|
|
|
+ checkStrictly: true,
|
|
|
+ value: 'value',
|
|
|
+ label: 'label', // 显示名称
|
|
|
+ children: 'children', // 子级字段名
|
|
|
+ }" />
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-input maxlength="64" :readonly="true" v-model="inputForm.contractTypes" placeholder="请输入合同类型"></el-input>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="签订日期" prop="contractDate"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入签约日期', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-date-picker
|
|
|
+ placement="bottom-start"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ v-model="inputForm.contractDate"
|
|
|
+ style="width: 100%"
|
|
|
+ v-if="status==='edit'"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-input maxlength="64" :readonly="true" v-model="inputForm.contractDate" placeholder="请输入签约日期"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同生效日期" prop="effectiveDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="inputForm.effectiveDate"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ style="width: 418px"
|
|
|
+ v-if="status==='edit'"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-input v-else maxlength="64" :readonly="true" v-model="inputForm.contractDate" placeholder="请输入合同生效日期"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="合同终止日期" prop="closingDate">
|
|
|
+ <el-date-picker
|
|
|
+ @change="checkData"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ v-model="inputForm.closingDate"
|
|
|
+ style="width: 418px"
|
|
|
+ v-if="status==='edit'"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-input v-else maxlength="64" :readonly="true" v-model="inputForm.contractDate" placeholder="请输入合同生效日期"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="对方合同编号" prop="contractOpposite">
|
|
|
+ <el-input maxlength="64" :readonly="true" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="department" label="所属部门"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请选择所属部门', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <SelectTree
|
|
|
+ ref="officeTree"
|
|
|
+ :props="{
|
|
|
+ value: 'id', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+
|
|
|
+ :url="`/system-server/sys/office/treeData?type=2`"
|
|
|
+ :value="inputForm.department"
|
|
|
+ :accordion="true"
|
|
|
+ size="default"
|
|
|
+ v-if="status==='edit'"
|
|
|
+ @getValue="(value) => {inputForm.department=value}"/>
|
|
|
+ <el-input v-else maxlength="64" :readonly="true" v-model="inputForm.department" placeholder="请填写所属部门"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="创建时间" prop="createTime">
|
|
|
+ <el-date-picker
|
|
|
+ placement="bottom-start"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ v-model="inputForm.createTime"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="true"
|
|
|
+ v-if="status==='edit'"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-input v-else maxlength="64" :readonly="true" v-model="inputForm.contractDate" placeholder="请输入合同生效日期"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+ <el-col :span="12" v-if="inputForm.contractAmountType === '1'">
|
|
|
+ <el-form-item label="合同金额(元)" prop="contractAmount"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入合同金额(元)', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input maxlength="15" v-model="inputForm.contractAmount" placeholder="请输入合同金额(元)" :readonly="true"
|
|
|
+ @keyup.native="inputForm.contractAmount = twoDecimalPlaces(inputForm.contractAmount)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="$store.state.user.office.name ==='办公室'">
|
|
|
+ <el-form-item label="盒号" prop="filedNo"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入盒号', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input :disabled="false" :readonly="false" maxlength="15" v-model="inputForm.filedNo" placeholder="请输入盒号"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col>
|
|
|
+ <el-form-item label="付款摘要" prop="paymentDescribe"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'请输入付款摘要', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input type="textarea" :readonly="true" v-model="inputForm.paymentDescribe" placeholder="请输入付款摘要"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col>
|
|
|
+ <el-form-item label="合同特别条款" prop="contractSpecial"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input type="textarea" :readonly="true" v-model="inputForm.contractSpecial" placeholder="请输入合同特别条款"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col>
|
|
|
+ <el-form-item label="备注" prop="remarks"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input type="textarea" :readonly="true" v-model="inputForm.remarks" placeholder="请输入备注"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-tabs v-model="activeName" type="border-card">
|
|
|
+ <el-tab-pane name="contactParty">
|
|
|
+ <template v-slot:label>
|
|
|
+ <span><span style="color: red;border-top: 20px">*</span> 委托方列表</span>
|
|
|
+ </template>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-button type="primary" style="margin-bottom: 15px" size="small" :disabled="true" @click="openWorkClient">
|
|
|
+ 新增委托方
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-form style="width: 100%;">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ show-overflow
|
|
|
+ show-footer
|
|
|
+ :column-config="{resizable: true}"
|
|
|
+ ref="contactTable"
|
|
|
+ :key="tableKeyClient"
|
|
|
+ class="vxe-table-element"
|
|
|
+ :data="inputForm.cwWorkClientContactDTOList"
|
|
|
+ style=""
|
|
|
+ highlight-current-row
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
|
|
|
+ >
|
|
|
+ <vxe-table-column align="center" field="no" title="客户编号" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input :readonly="true" v-model="scope.row.no" placeholder="客户编号" clearable></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="name" title="客户名称" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input :readonly="true" v-model="scope.row.name" placeholder="客户名称" clearable></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" title="操作" width="220px">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-button size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+<!-- <el-tabs v-model="activeName1" type="border-card">-->
|
|
|
+<!-- <el-tab-pane name="contractProper">-->
|
|
|
+<!-- <template v-slot:label>-->
|
|
|
+<!-- <span><span style="color: red;border-top: 20px">*</span> 合同附件信息</span>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- <!– 合同文件–>-->
|
|
|
+<!-- <UpLoadComponent ref="uploadComponent"></UpLoadComponent>-->
|
|
|
+<!-- </el-tab-pane>-->
|
|
|
+<!-- </el-tabs>-->
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+<!-- <el-image-viewer-->
|
|
|
+<!-- v-if="showViewer"-->
|
|
|
+<!-- :on-close="closeViewer"-->
|
|
|
+<!-- :url-list="[url]"-->
|
|
|
+<!-- zIndex="9999"/>-->
|
|
|
+ <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import WorkContractService from '@/api/jy/WorkContractService'
|
|
|
+ import WorkContractFileService from '@/api/jy/WorkContractFileService'
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
+ import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
+ import WorkClientForm from '../workClientInfo/WorkClientForm'
|
|
|
+ import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
|
|
|
+ import WorkClientChooseRadio from '../workClientInfo/WorkClientChooseRadio'
|
|
|
+ import dictService from "@/api/sys/dictService";
|
|
|
+ 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,
|
|
|
+ contractNoFlag: false,
|
|
|
+ typeData:[],
|
|
|
+ returnForm: {
|
|
|
+ customerId: '', // 客户id
|
|
|
+ address: '',
|
|
|
+ uscCode: '',
|
|
|
+ clientId: '',
|
|
|
+ name: '',
|
|
|
+ contractDate: '',
|
|
|
+ effectiveDate: '',
|
|
|
+ closingDate: '',
|
|
|
+ contractType: '',
|
|
|
+ contractAmountType: '',
|
|
|
+ contractAmount: '',
|
|
|
+ predictAmount: '',
|
|
|
+ contractOpposite: '',
|
|
|
+ contractFees: [],
|
|
|
+ fees: '',
|
|
|
+ contractFee: '',
|
|
|
+ describes: '',
|
|
|
+ contractSpecial: '',
|
|
|
+ remarks: '',
|
|
|
+ clientName: '',
|
|
|
+ workAttachmentList: [],
|
|
|
+ status: '',
|
|
|
+ customerNo: '',
|
|
|
+ customerName: '',
|
|
|
+ },
|
|
|
+ inputForm: {
|
|
|
+ customerId: '', // 客户id
|
|
|
+ address: '',
|
|
|
+ uscCode: '',
|
|
|
+ customerNo: '',
|
|
|
+ contractFees: [],
|
|
|
+ contractFee: '',
|
|
|
+ contractNo: '',
|
|
|
+ contractType: '',
|
|
|
+ contractName: '',
|
|
|
+ payerSubject: '',
|
|
|
+ paymentMethod: '',
|
|
|
+ paymentDescribe: '',
|
|
|
+ contractAmount: '',
|
|
|
+ predictAmount: '',
|
|
|
+ actualContractAmount: '',
|
|
|
+ contractNum: '2',
|
|
|
+ contractStatus: '新创建',
|
|
|
+ paymentAgreement: '',
|
|
|
+ changeNum: '0',
|
|
|
+ department: '',
|
|
|
+ clientContacts: '',
|
|
|
+ clientContactsPhone: '',
|
|
|
+ createBy: this.$store.state.user.name,
|
|
|
+ createId: this.$store.state.user.id,
|
|
|
+ createTime: '',
|
|
|
+ workAttachmentList: [],
|
|
|
+ cwWorkClientContactDTOList: [],
|
|
|
+ contractAmountType: '',
|
|
|
+ contractOpposite: '',
|
|
|
+ fees: '',
|
|
|
+ contractTypes:[],
|
|
|
+ primaryLinkman:'',
|
|
|
+ contractSpecial: '',
|
|
|
+ remarks: '',
|
|
|
+ contractDate:'',
|
|
|
+ effectiveDate: '',
|
|
|
+ closingDate: '',
|
|
|
+ filedNo:''
|
|
|
+ },
|
|
|
+ filesArra2: [],
|
|
|
+ fileList: [],
|
|
|
+ isFlag: true,
|
|
|
+ showViewer: false, // 显示查看器
|
|
|
+ url: '',
|
|
|
+ rowurl: '',
|
|
|
+ src: '',
|
|
|
+ onedit: false,
|
|
|
+ type: '',
|
|
|
+ loadProgress: 0, // 动态显示进度条
|
|
|
+ progressFlag: false, // 关闭进度条
|
|
|
+ promi: null,
|
|
|
+ tableKeyClient: '1',
|
|
|
+ keyWatch: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ businessId: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ formReadOnly: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ status: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ this.getTypeList()
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ // ElImageViewer,
|
|
|
+ UpLoadComponent,
|
|
|
+ SelectTree,
|
|
|
+ WorkClientForm,
|
|
|
+ WorkClientChooseForm,
|
|
|
+ WorkClientChooseRadio
|
|
|
+ },
|
|
|
+ ossService: null,
|
|
|
+ contractService:null,
|
|
|
+ WorkContractFileService:null,
|
|
|
+ created () {
|
|
|
+ this.ossService = new OSSSerive()
|
|
|
+ this.contractService=new WorkContractService()
|
|
|
+ this.workContractFileService=new WorkContractFileService()
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ window.onPreview = this.onPreview
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ officeName () {
|
|
|
+ return this.$store.state.user.office.name
|
|
|
+ },
|
|
|
+ bus: {
|
|
|
+ get () {
|
|
|
+ // this.$refs.archiveFile.setDividerName('附件', false)
|
|
|
+ this.$refs.uploadComponent.setDividerName('附件', false)
|
|
|
+ return this.businessId
|
|
|
+ },
|
|
|
+ set (val) {
|
|
|
+ this.businessId = val
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'keyWatch': {
|
|
|
+ handler (newVal) {
|
|
|
+ if (this.commonJS.isNotEmpty(this.bus)) {
|
|
|
+ this.init('', this.bus)
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getKeyWatch (keyWatch) {
|
|
|
+ this.keyWatch = keyWatch
|
|
|
+ },
|
|
|
+ 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.method = method
|
|
|
+ // console.log('method', method)
|
|
|
+ this.inputForm = {
|
|
|
+ customerId: '', // 客户id
|
|
|
+ address: '',
|
|
|
+ uscCode: '',
|
|
|
+ customerNo: '',
|
|
|
+ contractFees: [],
|
|
|
+ contractFee: '',
|
|
|
+ contractNo: '',
|
|
|
+ contractType: '',
|
|
|
+ contractName: '',
|
|
|
+ payerSubject: '',
|
|
|
+ paymentMethod: '',
|
|
|
+ paymentDescribe: '',
|
|
|
+ signingDate: '',
|
|
|
+ fees: '',
|
|
|
+ contractAmount: '',
|
|
|
+ predictAmount: '',
|
|
|
+ actualContractAmount: '',
|
|
|
+ contractNum: '',
|
|
|
+ contractStatus: '',
|
|
|
+ paymentAgreement: '',
|
|
|
+ changeNum: '',
|
|
|
+ department: '',
|
|
|
+ clientContacts: '',
|
|
|
+ clientContactsPhone: '',
|
|
|
+ createBy: this.$store.state.user.name,
|
|
|
+ createId: this.$store.state.user.id,
|
|
|
+ createTime: '',
|
|
|
+ workAttachmentList: [],
|
|
|
+ cwWorkClientContactDTOList: [],
|
|
|
+ contractAmountType: '',
|
|
|
+ contractOpposite: '',
|
|
|
+ contractTypes:[],
|
|
|
+ primaryLinkman:'',
|
|
|
+ filedNo:''
|
|
|
+ }
|
|
|
+ this.inputForm.id = id
|
|
|
+ if (method === 'add') {
|
|
|
+ // this.inputForm.id = 'add'
|
|
|
+ this.title = `新建合同`
|
|
|
+ } else if (method === 'edit') {
|
|
|
+ this.title = '修改合同'
|
|
|
+ } else if (method === 'view') {
|
|
|
+ this.inputForm.showVi = false
|
|
|
+ this.title = '查看合同详情'
|
|
|
+ }
|
|
|
+ this.visible = true
|
|
|
+ this.loading = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = true
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
|
+ // this.$refs.archiveFile.clearUpload()
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
+ this.contractService.findContractById(this.inputForm.id).then((data) => {
|
|
|
+ this.inputForm = this.recover(this.inputForm, data)
|
|
|
+ // this.inputForm.cwWorkClientContactDTOList=data.cwWorkClientContactDTOList
|
|
|
+ console.log('data', data)
|
|
|
+ this.inputForm.contractNo=data.no
|
|
|
+ this.inputForm.contractTypes=data.contractType
|
|
|
+ this.inputForm.contractDate=data.contractDate
|
|
|
+ if (this.formReadOnly) {
|
|
|
+ method = 'view'
|
|
|
+ }
|
|
|
+ this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract', null, null, null, null, false)
|
|
|
+ // this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看
|
|
|
+ view (id) {
|
|
|
+ this.$refs.workClientForm.init('view', id)
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ // eslint-disable-next-line no-dupe-keys
|
|
|
+ async insertEvent (type) {
|
|
|
+ if (type === 'client') {
|
|
|
+ let d = {
|
|
|
+ no: '',
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
|
|
|
+ this.inputForm.cwWorkClientContactDTOList = []
|
|
|
+ }
|
|
|
+ this.$refs.contactTable.insertAt(d)
|
|
|
+ this.inputForm.cwWorkClientContactDTOList.push(d)
|
|
|
+ this.tableKeyClient = Math.random()
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ removeEvent (row, rowIndex, type) {
|
|
|
+ if (type === 'client') {
|
|
|
+ this.$refs.contactTable.remove(row)
|
|
|
+ this.inputForm.cwWorkClientContactDTOList.splice(rowIndex, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openWorkClient () {
|
|
|
+ this.$refs.workClientChooseForm.init()
|
|
|
+ },
|
|
|
+ openWorkClient2 () {
|
|
|
+ this.$refs.workClientChooseRadio.init()
|
|
|
+ },
|
|
|
+ getWorkClientChoose (list) {
|
|
|
+
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
|
|
|
+ this.inputForm.cwWorkClientContactDTOList = []
|
|
|
+ }
|
|
|
+ let _this = this
|
|
|
+ let _list = list
|
|
|
+ const waitForEach = function () {
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ _list.forEach((item) => {
|
|
|
+ _this.inputForm.cwWorkClientContactDTOList.forEach(client => {
|
|
|
+ if (item.no === client.no) {
|
|
|
+ _this.$message.error('已存在客户 “' + client.name + '”,请重新选择')
|
|
|
+ throw new Error('已存在客户 “' + client.name + '”,请重新选择')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ resolve()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ waitForEach().then(() => {
|
|
|
+ list.forEach(item => {
|
|
|
+ this.$refs.contactTable.insertAt(item)
|
|
|
+ this.inputForm.cwWorkClientContactDTOList.push(item)
|
|
|
+ this.tableKeyClient = Math.random()
|
|
|
+ console.log('list', this.inputForm.cwWorkClientContactDTOList)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getWorkClientChoose2 (list) {
|
|
|
+ this.inputForm.customerNo = list.no
|
|
|
+ this.inputForm.uscCode = list.uscCode
|
|
|
+ this.inputForm.address = list.address
|
|
|
+ this.inputForm.customerId = list.id
|
|
|
+ this.inputForm.primaryLinkman = list.name
|
|
|
+ this.inputForm.clientContactsPhone = list.mobile
|
|
|
+ console.log('1231312',list)
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ // 暂存
|
|
|
+ doSubmit () {
|
|
|
+ this.loading = true
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('“委托方”中至少有一条数据')
|
|
|
+ throw new Error('“委托方”中至少有一条数据')
|
|
|
+ }
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ this.$refs['inputForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.inputForm.filedType = '0'
|
|
|
+ this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.workAttachmentList)) {
|
|
|
+ // 附件至少上传一条
|
|
|
+ this.$message.error('至少上传一个附件信息')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('至少上传一个附件信息')
|
|
|
+ }
|
|
|
+ this.inputForm.fees = this.inputForm.contractFees.join(',')
|
|
|
+ this.contractService.save(this.inputForm).then((data) => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ this.close()
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ startForm (callback) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
+ console.log('id',this.inputForm.id)
|
|
|
+ this.contractService.findContractById(this.inputForm.id).then((data) => {
|
|
|
+ if (this.commonJS.isNotEmpty(data.filedType) && data.filedType !== '0' && data.filedType !== '1' && data.filedType !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 送审
|
|
|
+ startFormTrue (callback) {
|
|
|
+ this.$refs['inputForm'].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
|
|
|
+ this.inputForm.filedType = '2'
|
|
|
+ this.inputForm.contractTypes=[]
|
|
|
+ await this.contractService.saveContract(this.inputForm).then((data) => {
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ reapplyForm (callback) {
|
|
|
+ this.loading = true
|
|
|
+ this.contractService.findContractById(this.inputForm.id).then((data) => {
|
|
|
+ if (data.filedType !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 通过
|
|
|
+ agreeForm (callback) {
|
|
|
+ this.loading = true
|
|
|
+ this.$refs['inputForm'].validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ await this.contractService.findContractById(this.inputForm.id).then((data) => {
|
|
|
+ if (data.filedType !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ this.loading = true
|
|
|
+ this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
|
|
|
+ if (this.$store.state.user.office.name ==='办公室'){
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.filedNo)) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('请输入盒号')
|
|
|
+ throw new Error('请输入盒号')
|
|
|
+ }
|
|
|
+ this.inputForm.filedType = '5'
|
|
|
+ }else {
|
|
|
+ this.inputForm.filedType = '2'
|
|
|
+ }
|
|
|
+ this.inputForm.contractTypes=[]
|
|
|
+ this.contractService.saveContract(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
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async updateStatusById (type, callback) {
|
|
|
+ this.loading = true
|
|
|
+ if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ this.contractService.findContractById(this.inputForm.id).then((data) => {
|
|
|
+ if (data.filedType !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ // if (type === 'agree') {
|
|
|
+ // // 同意
|
|
|
+ // this.inputForm.status = '5'
|
|
|
+ // }
|
|
|
+ if (type === 'reject') {
|
|
|
+ // 驳回
|
|
|
+ this.inputForm.filedType = '4'
|
|
|
+ }
|
|
|
+ if (type === 'reback') {
|
|
|
+ // 撤回
|
|
|
+ this.inputForm.filedType = '3'
|
|
|
+ }
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ let param = {filedType: this.inputForm.filedType, id: this.inputForm.id}
|
|
|
+ this.contractService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ this.loading = false
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 'hold') {
|
|
|
+ this.contractService.findContractById(this.inputForm.id).then((data) => {
|
|
|
+ if (data.filedType !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ // 终止
|
|
|
+ let param = {filedType: '1', id: this.inputForm.id}
|
|
|
+ this.contractService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ close () {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.inputForm.clientName = ''
|
|
|
+ this.inputForm.cwWorkClientContactDTOList = []
|
|
|
+ this.visible = false
|
|
|
+ this.showVi = true
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
|
+ },
|
|
|
+ tabHandleClick (event) {
|
|
|
+ // console.log(event)
|
|
|
+ },
|
|
|
+ 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.createTime = moment(new Date()).format('YYYY-MM-DD')
|
|
|
+ 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 > 2) {
|
|
|
+ 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;'
|
|
|
+ },
|
|
|
+ closePop () {
|
|
|
+ this.visable = false
|
|
|
+ },
|
|
|
+ checkData () {
|
|
|
+ let begin = this.inputForm.effectiveDate
|
|
|
+ let close = this.inputForm.closingDate
|
|
|
+ if (close < begin) {
|
|
|
+ this.$message.warning(`合同终止日期要大于合同开始日期`)
|
|
|
+ this.inputForm.closingDate = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查看客户信息详情
|
|
|
+ viewClient (id) {
|
|
|
+ this.$refs.workClientForm.init('view', id)
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取合同类型
|
|
|
+ getTypeList(){
|
|
|
+ dictService.getListData().then((data)=>{
|
|
|
+ this.typeData=data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //将合同类型进行绑定
|
|
|
+ handleChange(value){
|
|
|
+
|
|
|
+ // console.log('label',label)
|
|
|
+ this.inputForm.contractTypes=value
|
|
|
+ console.log('value',this.inputForm.contractTypes)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</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>
|