|
@@ -0,0 +1,664 @@
|
|
|
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ draggable
|
|
|
+ width="1500px"
|
|
|
+ @close="close"
|
|
|
+ @keyup.enter.native="doSubmit"
|
|
|
+ v-model="visible"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'"
|
|
|
+ label-width="110px" @submit.native.prevent>
|
|
|
+
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="批次" prop="batch"
|
|
|
+ :rules="[{required: true, message: '批次不能为空', trigger: 'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.batch" @focus="openTenderForm()" placeholder="请填写批次">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="openTenderForm()"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="创建人" prop="createName">
|
|
|
+ <el-input v-model="inputForm.createName" :disabled="true"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="创建人部门" prop="officeName">
|
|
|
+ <SelectTree
|
|
|
+ :disabled="true"
|
|
|
+ ref="officeTree"
|
|
|
+ :props="{
|
|
|
+ value: 'id', // ID字段名
|
|
|
+ label: 'name', // 显示名称
|
|
|
+ children: 'children' // 子级字段名
|
|
|
+ }"
|
|
|
+
|
|
|
+ :url="`/system-server/sys/office/treeData?type=2`"
|
|
|
+ :value="inputForm.officeName"
|
|
|
+ :accordion="true"
|
|
|
+ size="default"
|
|
|
+ @getValue="(value) => {inputForm.officeName=value}"/>
|
|
|
+ <!-- <el-input v-model="inputForm.handledByOffice" :disabled="true"></el-input>-->
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="报名截止时间" prop="applicationDeadline" :rules="[{required: true, message:'请选择报名截止时间', trigger:'blur'}]">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="inputForm.applicationDeadline"
|
|
|
+ :disabled="true"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placement="bottom-start"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="截标时间" prop="bidClosingTime" :rules="[{required: true, message:'请选择截标时间', trigger:'blur'}]">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="inputForm.bidClosingTime"
|
|
|
+ :disabled="true"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ placement="bottom-start"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <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-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div v-if="commonJS.isNotEmpty(inputForm.batch)">
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i>
|
|
|
+ 投标详情
|
|
|
+ </el-divider>
|
|
|
+ <el-row :gutter="15" >
|
|
|
+ <el-col :span="24">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ show-footer
|
|
|
+ show-overflow
|
|
|
+ :footer-method="footerMethod"
|
|
|
+ ref="detailTable"
|
|
|
+ class="vxe-table-element"
|
|
|
+ :data="inputForm.tenderList"
|
|
|
+ style="margin-left: 5em"
|
|
|
+ :key="clientTableKey"
|
|
|
+ highlight-current-row
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
|
|
|
+ :edit-rules="validRules"
|
|
|
+ >
|
|
|
+ <vxe-table-column align="center" field="createName" title="投标人" :edit-render="{}" :rules="[{required: true, message:'请选择投标人', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.createName" @focus="userPullListForm(scope.$rowIndex)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="officeName" title="投标部门" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input :disabled='true' v-model="scope.row.officeName" ></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="purchaseNumber" title="采购申请号" :edit-render="{}" :rules="[{required: true, message:'请输入采购申请号', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.purchaseNumber"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="subscaleNumber" title="分标编号" :edit-render="{}" :rules="[{required: true, message:'请输入分标编号', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.subscaleNumber"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="subscaleName" title="分标名称" :edit-render="{}" :rules="[{required: true, message:'请输入分标名称', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.subscaleName"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="packageNumber" title="包号" :edit-render="{}" :rules="[{required: true, message:'请输入包号', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.packageNumber"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="sectionName" title="招标项目标段名称" :edit-render="{}" :rules="[{required: true, message:'请输入招标项目标段名称', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.sectionName"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="money" title="采购金额(元)" :edit-render="{}" :rules="[{required: true, message:'请输入采购金额', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input @change="changeValue" maxlength="15" v-model="scope.row.money" @blur="scope.row.money = twoDecimalPlaces(scope.row.money)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="remarks" title="备注" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.remarks" ></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column title="操作" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <vxe-button size="small" v-if="method === 'bidAdd'" status="primary" :disabled="false" @click="bidCheck(scope.$rowIndex)">中标</vxe-button>
|
|
|
+ <vxe-button status="primary" size="small" v-if="method==='view'" :disabled="false" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</vxe-button>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <el-divider content-position="left"><i class="el-icon-document"></i>
|
|
|
+ 中标详情
|
|
|
+ <el-button style="margin-left: 20px" type="primary" @click="insertEvent('detail')" plain>
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ </el-divider>
|
|
|
+ <el-row :gutter="15" >
|
|
|
+ <el-col :span="24">
|
|
|
+ <vxe-table
|
|
|
+ border
|
|
|
+ show-footer
|
|
|
+ show-overflow
|
|
|
+ :footer-method="footerMethod"
|
|
|
+ ref="bidTable"
|
|
|
+ class="vxe-table-element"
|
|
|
+ :data="inputForm.bidDetails"
|
|
|
+ style="margin-left: 5em"
|
|
|
+ :key="bidTableKey"
|
|
|
+ highlight-current-row
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
|
|
|
+ :edit-rules="validRules"
|
|
|
+ >
|
|
|
+ <vxe-table-column align="center" field="createName" title="投标人" :edit-render="{}" :rules="[{required: true, message:'请选择投标人', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.createName" @focus="userPullListForm(scope.$rowIndex)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="officeName" title="投标部门" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input :disabled='true' v-model="scope.row.officeName" ></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="purchaseNumber" title="采购申请号" :edit-render="{}" :rules="[{required: true, message:'请输入采购申请号', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.purchaseNumber"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="subscaleNumber" title="分标编号" :edit-render="{}" :rules="[{required: true, message:'请输入分标编号', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.subscaleNumber"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="subscaleName" title="分标名称" :edit-render="{}" :rules="[{required: true, message:'请输入分标名称', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.subscaleName"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="packageNumber" title="包号" :edit-render="{}" :rules="[{required: true, message:'请输入包号', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.packageNumber"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="sectionName" title="招标项目标段名称" :edit-render="{}" :rules="[{required: true, message:'请输入招标项目标段名称', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.sectionName"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="money" title="采购金额(元)" :edit-render="{}" :rules="[{required: true, message:'请输入采购金额', trigger:'blur'}]">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input @change="changeValue" maxlength="15" v-model="scope.row.money" @blur="scope.row.money = twoDecimalPlaces(scope.row.money)"></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column align="center" field="remarks" title="备注" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <el-input v-model="scope.row.remarks" ></el-input>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ <vxe-table-column title="操作" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <vxe-button status="primary" size="small" v-show="method === 'view'" :disabled="false" @click="seeFileInfo2(scope.$rowIndex)">查看附件</vxe-button>
|
|
|
+ <vxe-button status="primary" size="small" v-if="method !== 'view'" @click="sss2(scope.$rowIndex)">上传附件</vxe-button>
|
|
|
+ <vxe-button status="danger" size="small" v-if="method !== 'view'" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</vxe-button>
|
|
|
+ </template>
|
|
|
+ </vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <!-- 附件 -->
|
|
|
+ <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
+ <MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
|
|
|
+ <UserPullForm ref="userPullForm" @getProgramForUser="getProgramForUser"></UserPullForm>
|
|
|
+ <TenderChooseForm ref="tenderChooseForm" @getProject="getTender"></TenderChooseForm>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
+ <el-button type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
+ import MaterialManagementDialog from '@/views/materialManagement/file/MaterialManagementDialog'
|
|
|
+ import TenderService from '@/api/jy/TenderService'
|
|
|
+ import BidService from '@/api/jy/BidService'
|
|
|
+ import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
+ import UserPullForm from '@/views/finance/invoice/UserPullForm'
|
|
|
+ import TenderChooseForm from "./TenderChooseForm";
|
|
|
+ import XEUtils from 'xe-utils'
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ validRules: {
|
|
|
+ createName: [
|
|
|
+ {required: true, message: '投标人不能为空'}
|
|
|
+ ],
|
|
|
+ purchaseNumber: [
|
|
|
+ {required: true, message: '采购申请号不能为空'}
|
|
|
+ ],
|
|
|
+ subscaleNumber: [
|
|
|
+ {required: true, message: '分标编号不能为空'}
|
|
|
+ ],
|
|
|
+ subscaleName: [
|
|
|
+ {required: true, message: '分标名称不能为空'}
|
|
|
+ ],
|
|
|
+ packageNumber: [
|
|
|
+ {required: true, message: '包号不能为空'}
|
|
|
+ ],
|
|
|
+ sectionName: [
|
|
|
+ {required: true, message: '招标项目标段名称不能为空'}
|
|
|
+ ],
|
|
|
+ money: [
|
|
|
+ {required: true, message: '采购金额不能为空'}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ title: '',
|
|
|
+ method: '',
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ inputForm: {
|
|
|
+ tenderId:'',//投标id
|
|
|
+ id:'',
|
|
|
+ totalMoney: '', // 采购金额总价
|
|
|
+ tenderList: [], //投标详情
|
|
|
+ batch: '', //批次
|
|
|
+ createName: '',
|
|
|
+ officeName: '',
|
|
|
+ applicationDeadline: '', //报名截止时间
|
|
|
+ bidClosingTime: '', // 截标时间
|
|
|
+ createById: '',
|
|
|
+ remarks: '',
|
|
|
+ files: [], // 附件信息
|
|
|
+ bidDetails:[] //中标详情
|
|
|
+ },
|
|
|
+ clientTableKey: '',
|
|
|
+ bidTableKey: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ TenderService: null,
|
|
|
+ BidService: null,
|
|
|
+ created () {
|
|
|
+ this.tenderService = new TenderService()
|
|
|
+ this.bidService = new BidService()
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ SelectTree,
|
|
|
+ MaterialManagementDialog,
|
|
|
+ UpLoadComponent,
|
|
|
+ UserPullForm,
|
|
|
+ TenderChooseForm
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ createName () {
|
|
|
+ return this.$store.state.user.name
|
|
|
+ },
|
|
|
+ officeName () {
|
|
|
+ return this.$store.state.user.office.name
|
|
|
+ },
|
|
|
+ bidMan () {
|
|
|
+ return this.$store.state.user.id
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init (method, id) {
|
|
|
+ console.log('method', method)
|
|
|
+ this.method = method
|
|
|
+ console.log('this.method', this.method)
|
|
|
+ this.inputForm = {
|
|
|
+ tenderId:'',//投标id
|
|
|
+ id:'',
|
|
|
+ totalMoney: '', // 采购金额总价
|
|
|
+ tenderList: [],
|
|
|
+ batch: '', //批次
|
|
|
+ createName: this.$store.state.user.name,
|
|
|
+ officeName: this.$store.state.user.office.id,
|
|
|
+ applicationDeadline: '', //报名截止时间
|
|
|
+ bidClosingTime: '', // 截标时间
|
|
|
+ createById: this.$store.state.user.id,
|
|
|
+ remarks: '',
|
|
|
+ files: [], // 附件信息
|
|
|
+ bidDetails:[] //中标详情
|
|
|
+ }
|
|
|
+ if (method === 'add') {
|
|
|
+ this.title = `新建中标信息`
|
|
|
+ } else if (method === 'edit') {
|
|
|
+ this.inputForm.id = id
|
|
|
+ this.title = '修改中标信息'
|
|
|
+ } else if (method === 'view') {
|
|
|
+ this.inputForm.id = id
|
|
|
+ this.title = '查看中标信息'
|
|
|
+ } else if (method === 'bidAdd') {
|
|
|
+ this.inputForm.tenderId = id
|
|
|
+ this.title = `新建中标信息`
|
|
|
+ this.getDetails(id)
|
|
|
+ }
|
|
|
+ this.visible = true
|
|
|
+ this.loading = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
+ this.loading = true
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.bidService.findById(this.inputForm.id).then((data) => {
|
|
|
+ this.inputForm = this.recover(this.inputForm, data)
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.createName)) {
|
|
|
+ this.inputForm.createName = this.$store.state.user.name
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.officeName)) {
|
|
|
+ this.inputForm.officeName = this.$store.state.user.office.name
|
|
|
+ }
|
|
|
+ console.log('id',this.inputForm)
|
|
|
+ this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'tenderBidFile')
|
|
|
+ this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getProgramForUser (rows) {
|
|
|
+ this.inputForm.tenderList[this.indexRow].bidMan = rows[0].id
|
|
|
+ this.inputForm.tenderList[this.indexRow].createName = rows[0].name
|
|
|
+ // this.inputForm.tenderList[this.indexRow].deptId = rows[0].parentId
|
|
|
+ this.inputForm.tenderList[this.indexRow].officeName = rows[0].officeName
|
|
|
+ this.indexRow = ''
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ getUpload (p, index) {
|
|
|
+ p.then((list) => {
|
|
|
+ // list为返回数据
|
|
|
+ this.inputForm.bidDetails[index].bidFiles = list
|
|
|
+ this.inputForm.bidDetails[index].fileNumber = list.length
|
|
|
+ this.bidTableKey = Math.random()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ },
|
|
|
+ // 采购人下拉弹窗
|
|
|
+ userPullListForm (rowIndex) {
|
|
|
+ this.indexRow = rowIndex
|
|
|
+ this.$refs.userPullForm.init()
|
|
|
+ },
|
|
|
+ footerMethod ({ columns, data }) {
|
|
|
+ const footerData = [
|
|
|
+ columns.map((column, columnIndex) => {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return '采购总价'
|
|
|
+ }
|
|
|
+ if (['money'].includes(column.property)) {
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
+ this.inputForm.totalMoney = XEUtils.sum(data, column.property)
|
|
|
+ return XEUtils.sum(data, column.property)
|
|
|
+ }
|
|
|
+ return null
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ return footerData
|
|
|
+ },
|
|
|
+ seeFileInfo (index) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.tenderList[index].bidFiles)) {
|
|
|
+ this.inputForm.tenderList[index].bidFiles = []
|
|
|
+ }
|
|
|
+ this.$refs.materialManagementDialog.newUpload('view', this.inputForm.tenderList[index].bidFiles, null, null, null, null, null, false, index)
|
|
|
+ },
|
|
|
+ sss (index) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.tenderList[index].bidFiles)) {
|
|
|
+ this.inputForm.tenderList[index].bidFiles = []
|
|
|
+ }
|
|
|
+ this.$refs.materialManagementDialog.newUpload(null, this.inputForm.tenderList[index].bidFiles, null, null, null, null, null, false, index)
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ doSubmit () {
|
|
|
+ this.$refs['inputForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.files)) {
|
|
|
+ this.loading = false
|
|
|
+ this.inputForm.files = []
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails)) {
|
|
|
+ this.$message.error('至少填写一条中标详情信息')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ let i = this.inputForm.bidDetails.length
|
|
|
+ for (let j = 0; j < i; j++) {
|
|
|
+ let k = j + 1
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].createName)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请选择采购人')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].purchaseNumber)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请输入采购申请号')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].subscaleNumber)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请输入分标编号')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].subscaleName)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请输入分标名称')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].packageNumber)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请输入包号')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].sectionName)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请输入招标项目标段名称')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[j].money)) {
|
|
|
+ this.$message.error('中标详情第' + k + '行请输入采购金额')
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
+ this.bidService.save(this.inputForm).then((data) => {
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
+ // callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ // this.$refs.inputForm.resetFields()
|
|
|
+ this.$emit('refreshList')
|
|
|
+ this.loading = false
|
|
|
+ this.close()
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close () {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.inputForm.detailInfos = []
|
|
|
+ this.inputForm.amountInfos = []
|
|
|
+ this.$refs.uploadComponent.clearUpload()
|
|
|
+ this.visible = false
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ removeEvent (row, rowIndex, type) {
|
|
|
+ if (type === 'detail') {
|
|
|
+ this.$refs.bidTable.remove(row)
|
|
|
+ this.inputForm.bidDetails.splice(rowIndex, 1)
|
|
|
+ }
|
|
|
+ if (type === 'amount') {
|
|
|
+ this.$refs.amountTable.remove(row)
|
|
|
+ this.inputForm.amountInfos.splice(rowIndex, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ async insertEvent (type) {
|
|
|
+ if (type === 'detail') {
|
|
|
+ await this.$refs.bidTable.insert().then((data) => {
|
|
|
+ data.bidMan = this.bidMan
|
|
|
+ data.createName = this.createName
|
|
|
+ data.officeName = this.officeName
|
|
|
+ this.inputForm.bidDetails.push(data)
|
|
|
+ this.bidTableKey = Math.random()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type === 'amount') {
|
|
|
+ await this.$refs.amountTable.insert().then((data) => {
|
|
|
+ this.inputForm.amountInfos.push(data)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bidCheck (index) {
|
|
|
+ // 将采购详情中的采购类型,商品名称,商品数量,商品单价,商品总结,带到入库详情中
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ let param = {
|
|
|
+ createName: this.createName,
|
|
|
+ bidMan: this.bidMan,
|
|
|
+ officeName: this.officeName,
|
|
|
+ purchaseNumber: this.inputForm.tenderList[index].purchaseNumber,
|
|
|
+ subscaleNumber: this.inputForm.tenderList[index].subscaleNumber,
|
|
|
+ subscaleName: this.inputForm.tenderList[index].subscaleName,
|
|
|
+ packageNumber: this.inputForm.tenderList[index].packageNumber,
|
|
|
+ sectionName: this.inputForm.tenderList[index].sectionName,
|
|
|
+ money: this.inputForm.tenderList[index].money,
|
|
|
+ remarks: this.inputForm.tenderList[index].remarks,
|
|
|
+ }
|
|
|
+ this.inputForm.bidDetails.push(param)
|
|
|
+ this.bidTableKey = Math.random()
|
|
|
+ },
|
|
|
+ getDetails(id){
|
|
|
+ this.tenderService.findById(id).then((data) => {
|
|
|
+ this.inputForm.batch = data.batch
|
|
|
+ this.inputForm.applicationDeadline = data.applicationDeadline
|
|
|
+ this.inputForm.createName = data.createName
|
|
|
+ this.inputForm.officeName = data.officeName
|
|
|
+ this.inputForm.bidClosingTime = data.bidClosingTime
|
|
|
+ this.inputForm.tenderList = data.tenderList
|
|
|
+ this.inputForm.bidDetails = []
|
|
|
+ })
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ seeFileInfo2 (index) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[index].bidFiles)) {
|
|
|
+ this.inputForm.bidDetails[index].bidFiles = []
|
|
|
+ }
|
|
|
+ this.$refs.materialManagementDialog.newUpload('view', this.inputForm.bidDetails[index].bidFiles, null, null, null, null, null, false, index)
|
|
|
+ },
|
|
|
+ sss2 (index) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.bidDetails[index].bidFiles)) {
|
|
|
+ this.inputForm.bidDetails[index].bidFiles = []
|
|
|
+ }
|
|
|
+ this.$refs.materialManagementDialog.newUpload(null, this.inputForm.bidDetails[index].bidFiles, null, null, null, null, null, false, index)
|
|
|
+ },
|
|
|
+ //获取投标批次
|
|
|
+ openTenderForm(){
|
|
|
+ this.$refs.tenderChooseForm.init();
|
|
|
+ },
|
|
|
+ getTender(row){
|
|
|
+ this.inputForm.batch = row.batch
|
|
|
+ this.inputForm.tenderId = row.id
|
|
|
+ this.inputForm.applicationDeadline = row.applicationDeadline
|
|
|
+ this.inputForm.createName = row.createName
|
|
|
+ this.inputForm.officeName = row.officeName
|
|
|
+ this.inputForm.bidClosingTime = row.bidClosingTime
|
|
|
+ this.tenderService.findById(row.id).then((data) => {
|
|
|
+ this.inputForm.tenderList = data.tenderList
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .el-divider__text {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .vxe-pulldown--panel {
|
|
|
+ z-index: 9997 !important
|
|
|
+ }
|
|
|
+</style>
|