123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587 |
- <template>
- <a-card :bordered="false" style="overflow: hidden;">
- <!-- 查询区域 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="任务名称">
- <a-input placeholder="请输入任务名称" v-model="queryParam.taskname"></a-input>
- </a-form-item>
- </a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="任务号">
- <a-input placeholder="请输入任务号" v-model="queryParam.taskno"></a-input>
- </a-form-item>
- </a-col>
- <template v-if="toggleSearchStatus">
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="型号">
- <a-input placeholder="请输入型号" v-model="queryParam.xhname"></a-input>
- </a-form-item>
- </a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="阶段">
- <a-input placeholder="请输入阶段" v-model="queryParam.yzjdname"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="计划完成时间">
- <j-date placeholder="请选择计划完成时间" v-model="queryParam.jhwcsj"></j-date>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="任务类型">
- <a-input placeholder="请输入任务类型" v-model="queryParam.tasktype"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="审计审价">
- <a-input placeholder="请输入审计审价" v-model="queryParam.auditprice"></a-input>
- </a-form-item>
- </a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="任务状态">
- <a-input placeholder="请输入任务状态" v-model="queryParam.iflag"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="项目进度">
- <a-input placeholder="请输入项目进度" v-model="queryParam.processpercent"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="成本进度">
- <a-input placeholder="请输入成本进度" v-model="queryParam.costPercent"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="业务员">
- <a-input placeholder="请输入业务员" v-model="queryParam.businessman"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="下达部门id">
- <a-input placeholder="请输入下达部门id" v-model="queryParam.jycsid"></a-input>
- </a-form-item>
- </a-col> -->
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="项目进度">
- <a-input placeholder="请输入项目进度" v-model="queryParam.processpercent"></a-input>
- </a-form-item>
- </a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="下达部门">
- <a-input placeholder="请输入下达部门" v-model="queryParam.jycs"></a-input>
- </a-form-item>
- </a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="责任部门">
- <a-input placeholder="请输入责任部门" v-model="queryParam.zrbm"></a-input>
- </a-form-item>
- </a-col>
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="批产任务号">
- <a-input placeholder="请输入批产任务号" v-model="queryParam.pccode"></a-input>
- </a-form-item>
- </a-col> -->
- <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="备产任务号">
- <a-input placeholder="请输入备产任务号" v-model="queryParam.bccode"></a-input>
- </a-form-item>
- </a-col>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <a-form-item label="备料任务号">
- <a-input placeholder="请输入备料任务号" v-model="queryParam.blcode"></a-input>
- </a-form-item>
- </a-col> -->
- </template>
- <a-col :xl="6" :lg="7" :md="8" :sm="24">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- <a @click="handleToggleSearch" style="margin-left: 8px">
- {{ toggleSearchStatus ? '收起' : '展开' }}
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 查询区域-END -->
- <!-- 操作按钮区域 -->
- <div class="table-operator">
- <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
- <a-button @click="handleExpand" type="primary" icon="column-height">折叠/展开</a-button>
- <a-button @click="handleAdd" type="primary" icon="plus">导入</a-button>
- <a-button @click="handleComputed" type="primary" icon="reconciliation">计算</a-button>
- <a-button type="primary" icon="download" @click="handleExportXls()">导出</a-button>
- <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
- <a-button type="primary" icon="import">导入</a-button>
- </a-upload> -->
- <!-- 高级查询区域 -->
- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
- <a-button @click="batchDuiBi" :disabled="chooseStatus"><a-icon type="shrink" />比对</a-button>
- <!-- <a-dropdown v-if="selectedRowKeys.length > 0"> -->
- <!-- <a-menu slot="overlay"> -->
- <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>比对</a-menu-item> -->
- <!-- <a-menu-item key="1" @click="batchDuiBi"><a-icon type="shrink" />比对</a-menu-item>
- </a-menu>
- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> -->
- <!-- </a-dropdown> -->
- </div>
- <!-- table区域-begin -->
- <div>
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
- <a style="margin-left: 24px" @click="onClearSelected">清空</a>
- <span style="margin-left: 40px; color: #b5b5b5;">*红色表示亏损;绿色表示加入至产品价格库;灰色表示解组批后;*</span>
- <span style="float:right;">
- <a @click="loadData()"><a-icon type="sync" />刷新</a>
- <a-divider type="vertical" />
- <a-popover title="自定义列" trigger="click" placement="leftBottom">
- <template slot="content">
- <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
- <a-row style="width: 400px">
- <template v-for="(item, index) in defColumns">
- <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
- <a-col :span="12" :key="index">
- <a-checkbox :value="item.dataIndex" :disabled="!!item.fixed" :checked="!!item.fixed">
- {{ item.title }}</a-checkbox>
- </a-col>
- </template>
- </template>
- </a-row>
- </a-checkbox-group>
- </template>
- <a><a-icon type="setting" />自定义列</a>
- </a-popover>
- </span>
- </div>
- <a-table
- ref="table"
- size="middle"
- :scroll="{x:true,}"
- bordered
- rowKey="id"
- :columns="columns"
- :dataSource="dataSource"
- :pagination="ipagination"
- :loading="loading"
- class="j-table-force-nowrap"
- :expandedRowKeys="expandedRowKeys"
- @expand="onExpand"
- @mousedown.native="mouseDownHandler"
- @mouseup.native="mouseUpHandler"
- @mousemove.native="mouseMoveHandler"
- :rowClassName="setRowClassName"
- :rowSelection="{
- selectedRowKeys: selectedRowKeys,
- onChange: onSelectChange,
- onSelect: onSelect,
- getCheckboxProps: (record) => ({
- props: {
- //disabled: record.id == 'amount', // 禁选的条件为:合计行不可选
- disabled: record.id == 'amount' ||
- (record.ji== '1' && chooseRowType == 'huiji') ||
- (record.ji== '2' && chooseRowType == 'chengben')
- },
- }),}"
- @change="handleTableChange"
- :indentSize="12">
- <template slot="htmlSlot" slot-scope="text">
- <div v-html="text"></div>
- </template>
- <template slot="imgSlot" slot-scope="text,record">
- <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
- <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
- </template>
- <template slot="fileSlot" slot-scope="text">
- <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
- <a-button
- v-else
- :ghost="true"
- type="primary"
- icon="download"
- size="small"
- @click="downloadFile(text)">
- 下载
- </a-button>
- </template>
- <div slot="filterDropdown">
- <a-card>
- <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
- <a-row style="width: 400px">
- <template v-for="(item, index) in defColumns">
- <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
- <a-col :span="12" :key="index"><a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox></a-col>
- </template>
- </template>
- </a-row>
- </a-checkbox-group>
- </a-card>
- </div>
- <a-icon slot="filterIcon" type='setting' :style="{ fontSize:'16px',color: '#108ee9' }" />
- <!-- <span slot="contractfpe" slot-scope="text, record">
- <a-button type="link" @click.native="detailClick(text,record,'contractfpe','合同额')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span> -->
- <!-- <span slot="taskmoney" slot-scope="text, record">
- <a-button type="link" @click="detailClick(text,record,'taskmoney','已收款')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span> -->
- <!-- <span slot="clf" slot-scope="text, record">
- <a-button type="link" @click="detailClick(text,record,'clf','材料费')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span> -->
- <!-- <span slot="zyf" slot-scope="text, record">
- <a-button type="link" @click="detailClick(text,record,'zyf','专用费')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span> -->
- <!-- <span slot="swf" slot-scope="text, record">
- <a-button type="link" @click="detailClick(text,record,'swf','事务费')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span> -->
- <!-- <span slot="wxf" slot-scope="text, record">
- <a-button type="link" @click.native="detailClick(text,record,'wxf','外协费')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span>
- <span slot="zjcb" slot-scope="text, record">
- <a-button type="link" @click="detailClick(text,record,'zjcb','装机成本')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{(Number(text)/10000).toFixed(2)}}</a-button>
- </span>
- <span slot="workhour" slot-scope="text, record">
- <a-button type="link" @click="detailClick(text,record,'workhour','工时')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{text}}</a-button>
- </span> -->
- <span slot="action" slot-scope="text, record">
- <!-- <a @click="handleEdit(record)">编辑</a> -->
- <!-- <a-tooltip v-if="record.id !== 'amount' && record.ji === 1">
- <template slot="title">
- 汇集层无预算执行
- </template>
- <span style="color: rgba(0,0,0,.25);">预算执行</span>
- </a-tooltip> -->
- <a @click="handleXushi(record)" v-if="record.id !== 'amount'">预算执行</a>
- <!-- <a @click="handleXushi(record)" v-if="record.id !== 'amount'" :disabled="record.ji === 1">预算执行</a> -->
- <a-divider v-if="record.id !== 'amount' && record.ji === 1" type="vertical" />
- <a @click="handleAddProjectModel(record)" v-if="record.id !== 'amount' && record.ji === 1" :disabled="record.hjstatus === '4'">加入产品</a>
- <!-- <a-dropdown>
- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
- <a-menu slot="overlay">
- <a-menu-item>
- <a @click="handleDetail(record)">详情</a>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
- <a>删除</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- </a-dropdown> -->
- </span>
- </a-table>
- </div>
- <!-- 详情弹窗 -->
- <project-detail-modal ref="proCostDetail"></project-detail-modal>
- <!-- 总成本弹窗 -->
- <project-zcb-detail-modal ref="proCostZcbDetail"></project-zcb-detail-modal>
- <j-modal
- :width="1200"
- :visible="duiBi"
- switchFullscreen
- @cancel="handleGb">
- <a-tabs default-active-key="1">
- <a-tab-pane key="1" tab="总体比对">
- <all-list :duibiIds="duibiIds" :chooseRowType="chooseRowType"></all-list>
- <!-- <all-list :duibiList="duibiList"></all-list> -->
- </a-tab-pane>
- <a-tab-pane key="2" tab="材料费比对" force-render>
- <wuliao-list :chooseRowType="chooseRowType" :duibiTasknos="duibiTasknos" ></wuliao-list>
- <!-- <wuliao-list :duibiclList="duibiclList"></wuliao-list> -->
- </a-tab-pane>
- </a-tabs>
- <template slot="footer">
- <a-button @click="handleGb">关闭</a-button>
- </template>
- </j-modal>
- <!-- 虚实成本比对(堆叠图) -->
- <contrast-modal ref="xushi"></contrast-modal>
- <!-- 导入弹框 -->
- <project-import-list-modal ref="modalForm" @ok="modalFormOk" :isAllShow="false"></project-import-list-modal>
- </a-card>
- </template>
- <script>
- import Vue from 'vue';
- // import VueDraggableResizable from 'vue-draggable-resizable';
- // Vue.component('vue-draggable-resizable', VueDraggableResizable);
- import { columnsSelect, columnsEdit, proCostYSKdetail, proCostContractdetail, getDbList, getHjList, getDbClList, insertIntoProject, visibleClientStart } from '@/api/kzksApi.js'
- import '@/assets/less/TableExpand.less'
- import { mixinDevice } from '@/utils/mixin'
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import ProjectDetailModal from './modulesDetail/ProjectDetailModal'
- import ProjectZcbDetailModal from './modulesDetail/ProjectZcbDetailModal'
- import AllList from '../projectContrastList/allList.vue'
- import WuliaoList from '../projectContrastList/wuliaoList.vue'
- import { getAction, downFile } from '@/api/manage'
- import ContrastModal from '../projectXushiContrast/contrastModal.vue'
- import ProjectImportListModal from '../projectImportList/modules/ProjectImportListModal.vue'
- import { number } from 'echarts';
- export default {
- name: 'ProjectCostList',
- mixins:[JeecgListMixin, mixinDevice],
- components: {
- AllList,
- WuliaoList,
- ProjectDetailModal,
- ProjectZcbDetailModal,
- ContrastModal,
- ProjectImportListModal,
- },
- data () {
- return {
- scrollHeight: 700,
- /* 分页参数 */
- ipagination:{
- current: 1,
- pageSize: 11, // 设置a-table调用时加上筛选行
- pageSizeOptions: ['11', '21', '31'],
- showTotal: (total, range) => {
- var current = this.ipagination.current
- if(this.showListTotal){
- return (range[0] - current + 1) + "-" + (range[1] - current) + " 共" + this.showListTotal + "条"
- } else {
- return range[0] + "-" + range[1] + " 共" + total + "条"
- }
- },
- showQuickJumper: true,
- showSizeChanger: true,
- total: 0,
- // 显示时减去筛选行
- buildOptionText: (size) => {
- return new Number(size.value) - 1 + '条/页'
- }
- },
- // 用来前端显示出去筛选行的total
- showListTotal: 0,
- description: '项目成本管理页面',
- // 一键折叠/展开
- expandedRowKeys: [],
- // 是否全部展开
- isExpanded: false,
- // 获取比对级
- chooseRowType: undefined,
- // 比对状态
- chooseStatus: true,
- // 获取到的比对数据
- duibiList: {},
- // 获取到的材料费比对数据
- duibiclList: [],
- // 比对弹框是否显示
- duiBi: false,
- // 表头:当前显示的列,初始为全部
- columns: [],
- //列设置:多选弹窗显示的
- settingColumns:[],
- //列定义:所有列
- defColumns: [
- // {
- // title: '#',
- // dataIndex: '',
- // key:'rowIndex',
- // width:60,
- // align:"center",
- // customRender:function (t,r,index) {
- // return parseInt(index)+1;
- // }
- // },
- {
- title:'任务号',
- fixed:"left",
- dataIndex: 'taskno',
- width: 120,
- customHeaderCell:() => ({
- style: {
- textAlign: 'center', // 表头居中
- }
- })
- },
- {
- title:'任务名称',
- align:"center",
- fixed:"left",
- width: 120,
- dataIndex: 'taskname',
- ellipsis: true,
- },
- {
- title:'型号',
- align:"center",
- width: 120,
- dataIndex: 'xhname',
- },
- {
- title:'计划完成时间',
- align:"center",
- width: 120,
- dataIndex: 'jhwcsj',
- customRender:function (text) {
- return !text?"":(text.length>10?text.substr(0,10):text)
- }
- },
- {
- title:'阶段',
- align:"center",
- width: 80,
- dataIndex: 'yzjdname'
- },
- {
- title:'项目进度',
- align:"center",
- width: 80,
- dataIndex: 'processpercent',
- customRender: (text, record) => {
- return record.id === 'amount'?null:parseInt(text)+ '%'
- },
- },
- {
- title:'成本进度',
- align:"center",
- width: 80,
- dataIndex: 'costPercent',
- customRender: (text, record) => {
- return record.id === 'amount'?null:(Number(text) * 100).toFixed(0) + '%'
- },
- },
- {
- title:'已收款',
- align:"center",
- width: 80,
- dataIndex: 'taskmoney',
- // scopedSlots: {
- // customRender: 'taskmoney',
- // },
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'taskmoney', '已收款')}
- },
- {
- title:'合同额',
- align:"center",
- width: 80,
- dataIndex: 'contractfpe',
- // scopedSlots: {
- // customRender: 'contractfpe',
- // },
- // customCell: this.getClickColumn,
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'contractfpe', '合同额')}
- },
- {
- title:'预估价',
- align:"center",
- width: 80,
- dataIndex: 'estimationcoat',
- customRender: (text, record) => {
- return record.contractfpe ? '-' : Number(text).toFixed(2)
- },
- },
- {
- title:'项目预算',
- align:"center",
- width: 80,
- dataIndex: 'xmys',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- },
- {
- title:'总成本',
- align:"center",
- width: 80,
- dataIndex: 'zcb',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellZcbDetail(record, index, 'zcb', '总成本')}
- },
- {
- title:'利润额',
- align:"center",
- width: 80,
- dataIndex: 'lre',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- },
- {
- title:'利润率',
- align:"center",
- width: 80,
- dataIndex: 'lrl',
- customRender: (text) => {
- return (Number(text) * 100).toFixed(1) + '%'
- },
- },
- {
- title:'研制数量',
- align:"center",
- width: 80,
- dataIndex: 'yzsl'
- },
- {
- title:'单台利润',
- align:"center",
- width: 80,
- dataIndex: 'oneProfit',
- customRender: (text, record) => {
- return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
- },
- },
- {
- title:'单台收入',
- align:"center",
- width: 80,
- dataIndex: 'oneIncome',
- customRender: (text, record) => {
- return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
- },
- },
- {
- title:'单台成本',
- align:"center",
- width: 80,
- dataIndex: 'oneCost',
- customRender: (text, record) => {
- return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
- },
- },
- {
- title:'材料预算',
- align:"center",
- width: 80,
- dataIndex: 'clys',
- customRender: (text) => {
- return Number(text).toFixed(2)
- },
- },
- {
- title:'材料费',
- align:"center",
- width: 80,
- dataIndex: 'clf',
- // scopedSlots: {
- // customRender: 'clf',
- // },
- // customRender: (text) => {
- // return (Number(text)/10000).toFixed(2)
- // },
- customRender:function (text,record,index) {
- var wanyuan = (Number(text)/10000).toFixed(2)
- let classTag = {
- class: `${ record.id !== 'amount' && record.clys != 0 && wanyuan > record.clys ? 'exceed-budget-status':''}`
- }
- return {
- children: (
- <span {...classTag}>{wanyuan}</span>
- )
- };
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'clf', '材料费')}
- },
- {
- title:'专用预算',
- align:"center",
- width: 80,
- dataIndex: 'zyys',
- customRender: (text) => {
- return Number(text).toFixed(2)
- },
- },
- {
- title:'专用费',
- align:"center",
- width: 80,
- dataIndex: 'zyf',
- // scopedSlots: {
- // customRender: 'zyf',
- // },
- customRender:function (text,record,index) {
- var wanyuan = (Number(text)/10000).toFixed(2)
- let classTag = {
- class: `${ record.id !== 'amount' && record.zyys != 0 && wanyuan > record.zyys ? 'exceed-budget-status':''}`
- }
- return {
- children: (
- <span {...classTag}>{wanyuan}</span>
- )
- };
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'zyf', '专用费')}
- },
- {
- title:'事务预算',
- align:"center",
- width: 80,
- dataIndex: 'swys',
- customRender: (text) => {
- return Number(text).toFixed(2)
- },
- },
- {
- title:'事务费',
- align:"center",
- width: 80,
- dataIndex: 'swf',
- // scopedSlots: {
- // customRender: 'swf',
- // },
- customRender:function (text,record,index) {
- var wanyuan = (Number(text)/10000).toFixed(2)
- let classTag = {
- class: `${ record.id !== 'amount' && record.swys != 0 && wanyuan > record.swys ? 'exceed-budget-status':''}`
- }
- return {
- children: (
- <span {...classTag}>{wanyuan}</span>
- )
- };
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'swf', '事务费')}
- },
- {
- title:'外协预算',
- align:"center",
- width: 80,
- dataIndex: 'wxys',
- customRender: (text) => {
- return Number(text).toFixed(2)
- },
- },
- {
- title:'外协费',
- align:"center",
- width: 80,
- dataIndex: 'wxf',
- // scopedSlots: {
- // customRender: 'wxf',
- // },
- customRender:function (text,record,index) {
- var wanyuan = (Number(text)/10000).toFixed(2)
- let classTag = {
- class: `${ record.id !== 'amount' && record.wxys != 0 && wanyuan > record.wxys ? 'exceed-budget-status':''}`
- }
- return {
- children: (
- <span {...classTag}>{wanyuan}</span>
- )
- };
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'wxf', '外协费')}
- },
- {
- title:'间接预算',
- align:"center",
- width: 80,
- dataIndex: 'jjys',
- customRender: (text) => {
- return Number(text).toFixed(2)
- },
- },
- {
- title:'间接汇总',
- align:"center",
- width: 80,
- dataIndex: 'jjfhz',
- // customRender: (text) => {
- // return Number(text).toFixed(2)
- // },
- customRender:function (text,record,index) {
- var wanyuan = (Number(text)/10000).toFixed(2)
- let classTag = {
- class: `${ record.id !== 'amount' && record.jjys != 0 && wanyuan > record.jjys ? 'exceed-budget-status':''}`
- }
- return {
- children: (
- <span {...classTag}>{wanyuan}</span>
- )
- };
- },
- },
- {
- title:'燃动费',
- align:"center",
- width: 80,
- dataIndex: 'rldlf',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'rldlf', '燃动费')}
- },
- {
- title:'固资费',
- align:"center",
- width: 80,
- dataIndex: 'gdzczj',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'gdzczj', '固资费')}
- },
- {
- title:'人工费',
- align:"center",
- width: 80,
- dataIndex: 'gzjlwf',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'gzjlwf', '人工费')}
- },
- {
- title:'管理费',
- align:"center",
- width: 80,
- dataIndex: 'glf',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'glf', '管理费')}
- },
- {
- title:'筛选费',
- align:"center",
- width: 80,
- dataIndex: 'sxf',
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'sxf', '筛选费')}
- },
- {
- title:'装机成本',
- align:"center",
- width: 80,
- dataIndex: 'zjcb',
- // scopedSlots: {
- // customRender: 'zjcb',
- // },
- customRender: (text) => {
- return (Number(text)/10000).toFixed(2)
- },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'zjcb', '装机成本')}
- },
- {
- title:'内部试验',
- align:"center",
- width: 80,
- dataIndex: 'lbsy',
- ellipsis: true,
- },
- {
- title:'工时(h)',
- align:"center",
- width: 80,
- dataIndex: 'workhour',
- // scopedSlots: {
- // customRender: 'workhour',
- // },
- customCell: (record, index)=>{ return this.customCellDetail(record, index, 'workhour', '工时')}
- },
- {
- title:'责任部门',
- align:"center",
- width: 120,
- dataIndex: 'zrbm',
- ellipsis: true,
- },
- // {
- // title:'下达部门id',
- // align:"center",
- // dataIndex: 'jycsid'
- // },
- {
- title:'下达部门',
- align:"center",
- width: 120,
- dataIndex: 'jycs',
- ellipsis: true,
- },
- // {
- // title:'1:横向 2:纵向',
- // align:"center",
- // dataIndex: 'hxzxid'
- // },
- {
- title:'横向纵向',
- align:"center",
- width: 80,
- dataIndex: 'hxzxname'
- },
- {
- title:'任务类型',
- align:"center",
- width: 80,
- dataIndex: 'tasktype'
- },
- {
- title:'审计审价',
- align:"center",
- width: 80,
- dataIndex: 'auditprice'
- },
- {
- title:'任务状态',
- align:"center",
- width: 80,
- dataIndex: 'iflag'
- },
- {
- title:'提出单位简称',
- align:"center",
- width: 120,
- dataIndex: 'brief'
- },
- {
- title:'父级任务',
- align:"center",
- width: 80,
- dataIndex: 'reftaskno'
- },
- {
- title:'批产任务号',
- align:"center",
- width: 80,
- dataIndex: 'pccode'
- },
- {
- title:'备产任务号',
- align:"center",
- width: 80,
- dataIndex: 'bccode'
- },
- {
- title:'备料任务号',
- align:"center",
- width: 80,
- dataIndex: 'blcode'
- },
- {
- title:'业务员',
- align:"center",
- width: 80,
- dataIndex: 'businessManName',
- ellipsis: true,
- },
- {
- title:'主管设计师',
- align:"center",
- width: 100,
- dataIndex: 'ywfzrname',
- ellipsis: true,
- },
- {
- title:'科研任务负责人',
- align:"center",
- width: 120,
- dataIndex: 'xhzzrname',
- ellipsis: true,
- },
- {
- title:'设计工时',
- align:"center",
- width: 80,
- dataIndex: 'sjgs'
- },
- {
- title:'生产工时',
- align:"center",
- width: 80,
- dataIndex: 'scgs'
- },
- // {
- // title:'级别',
- // align:"center",
- // dataIndex: 'ji',
- // customCell: this.getClickColumn,
- // },
- {
- title: '操作',
- dataIndex: 'action',
- align:"center",
- fixed:"right",
- width: 150,
- scopedSlots: {
- // filterDropdown: 'filterDropdown',
- // filterIcon: 'filterIcon',
- customRender: 'action',
- }
- }
- ],
- url: {
- list: "/projectCostHuiji/projectCostHuiji/list",
- // delete: "/projectCost/projectCost/delete",
- // deleteBatch: "/projectCost/projectCost/deleteBatch",
- exportXlsUrl: "/projectCostHuiji/projectCostHuiji/exportXlsProjectCost",
- importExcelUrl: "projectCost/projectCost/importExcel",
- },
- dictOptions:{},
- superFieldList:[],
- // 拖拽
- handlerFirstTime: null,
- isClick: false,
- mouseFlag: false,
- mouseOffset: null,
- // 比对
- duibiIds: '',
- duibiTasknos: '',
- }
- },
- created() {
- this.loadData()
- this.initColumns();
- this.getSuperFieldList();
- },
- mounted() {
- // console.log(window.innerHeight, this.$refs.table)
- this.$nextTick(() => {
- this.scrollHeight = window.innerHeight - 60 - 25 - 55 - 25
- // this.scrollHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 60 - 52 - 50 - 56 - 60 - 34
- })
- },
- computed: {
- importExcelUrl: function(){
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
- },
- },
- methods: {
- // 按下鼠标记录鼠标位置
- mouseDownHandler(e) {
- this.mouseOffset = e.clientX;
- this.handlerFirstTime = new Date().getTime()
- this.mouseFlag = true;
- // console.log(this.mouseOffset)
- },
- mouseUpHandler(e) {
- var lastTime = new Date().getTime();
- this.mouseFlag = false;
- if( (lastTime - this.handlerFirstTime) < 100){
- this.isClick = true
- } else {
- this.isClick = false
- }
- },
- mouseMoveHandler(e) {
- // 这里面需要注意,通过ref需要那个那个包含table元素的父元素
- let v=document.getElementsByClassName("ant-table-body")[0]
- v.style.cursor = 'move'
- v.style['user-select'] = 'none'
- if (this.mouseFlag) {
- // 设置水平方向的元素的位置
- v.scrollLeft -= (- this.mouseOffset + (this.mouseOffset = e.clientX));
- }
- },
- loadData(arg) {
- if(!this.url.list){
- this.$message.error("请设置url.list属性!")
- return
- }
- //加载数据 若传入参数1则加载第一页的内容
- if (arg === 1) {
- this.ipagination.current = 1;
- }
- var params = this.getQueryParams();//查询条件
- // 查询时减去筛选行
- params.pageSize = (Number(params.pageSize) - 1).toString()
- this.loading = true;
- getAction(this.url.list, params).then((res) => {
- if (res.success) {
- //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
- this.dataSource = res.result.pageList.records||res.result.pageList;
- var amount = res.result.projectCostHuiji
- amount.taskno = '筛选合计:'
- amount.id = 'amount'
- // amount.id = 'amount'+res.result.pageList.current
- this.dataSource.unshift(amount)
- if(res.result.pageList.total)
- {
- // 解决页数显示不对的问题:因为a-table当前默认是加上筛选行的,合计时几页就加上几
- // 例如:当前total后端返回32,一页10个应该是4页,但是a-table调用的是一页11个,所以32/11 会显示3页
- this.ipagination.total = res.result.pageList.total + res.result.pageList.pages;
- // 设置显示的total数
- this.showListTotal = res.result.pageList.total
- }else{
- this.ipagination.total = 0;
- }
- //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
- }else{
- this.$message.warning(res.message)
- }
- }).finally(() => {
- this.loading = false
- })
- },
- initDictConfig(){
- },
- initColumns(){
- //权限过滤(列权限控制时打开,修改第二个参数为授权码前缀)
- // this.defColumns = colAuthFilter(this.defColumns,'testdemo:');
- columnsSelect().then(res => {
- let colSettings = res
- if(colSettings==null||colSettings==undefined || colSettings.length === 0){
- let allSettingColumns = [];
- this.defColumns.forEach(function (item,i,array ) {
- allSettingColumns.push(item.dataIndex);
- })
- this.settingColumns = allSettingColumns;
- this.columns = this.defColumns;
- }else{
- this.settingColumns = colSettings;
- const cols = this.defColumns.filter(item => {
- if(item.key =='rowIndex'|| item.dataIndex=='action'){
- return true;
- }
- if (colSettings.includes(item.dataIndex)) {
- return true;
- }
- return false;
- })
- this.columns = cols;
- }
- })
- // 储存浏览器方式
- // var key = this.$route.name+":colsettings";
- // let colSettings= Vue.ls.get(key);
- },
- // 行颜色设置
- setRowClassName(record, index){
- if(record.lrl < 0){
- // 亏损标红
- return 'table-kuisun-color'
- }
- if(record.status === '1'){
- // 汇集计算之后的数据标浅灰
- return 'table-zupi-color'
- }
- if(record.hjstatus === '4'){
- // 加入产品价格库的
- return 'table-chanpin-model-color'
- }
- },
- //列设置更改事件
- onColSettingsChange (checkedValues) {
- // 获取浏览器方式
- // var key = this.$route.name+":colsettings";
- // Vue.ls.set(key, checkedValues, 7 * 24 * 60 * 60 * 1000)
- this.settingColumns = checkedValues;
- const cols = this.defColumns.filter(item => {
- if(item.key =='rowIndex'|| item.dataIndex=='action'){
- return true
- }
- if (this.settingColumns.includes(item.dataIndex)) {
- return true
- }
- return false
- })
- this.columns = cols;
- columnsEdit({checkedValues: checkedValues})
- },
- customCellDetail(record, index, columnValue, columnTitle){
- // if(record.children || record.id === 'amount'){
- // return false
- // }
- // 改成汇集层也需要弹窗且汇集层装机成本和工时不弹窗
- if(record.id === 'amount' || (record.ji === 1 && columnValue === 'zjcb') || (record.ji === 1 && columnValue === 'workhour')){
- return false
- }
- return {
- style: {
- // 'color': "#1890ff",
- 'color': "#1890ff !important",
- 'cursor': "pointer",
- },
- on: {
- // 点击事件
- click: (event) => {
-
- },
- dblclick: (event) => {
- // console.log(record, index, columnValue, columnTitle)
- // 没有值不弹窗--也弹窗
- // if(!event.target.textContent){
- // return
- // }
- if(record.ji === 1){
- // 汇集层传所有子级任务号
- var tasknos = record.children.map(item=>item.taskno)
- this.$refs.proCostDetail.taskno = tasknos.join(',')
- // this.$refs.proCostDetail.taskno = tasknos.toString()
- }
- if(record.ji === 2){
- this.$refs.proCostDetail.taskno = record.taskno
- }
- this.$refs.proCostDetail.cengji = record.ji
- if(record.status === '1' && columnValue === 'clf'){
- // 批产参数
- this.$refs.proCostDetail.pichanInfo = {
- pccode: record.pccode,
- proportion: record.proportion,
- columnValue: columnValue,
- }
- // console.log(columnValue)
- this.$refs.proCostDetail.columnValue = 'pichanTask'
- this.$refs.proCostDetail.title = columnTitle + '批产明细'
- } else {
- this.$refs.proCostDetail.columnValue = columnValue
- this.$refs.proCostDetail.title = columnTitle + '明细'
- }
- this.$refs.proCostDetail.show()
- },
- contextmenu: (event) => {},
- mouseenter: (event) => {}, // 鼠标移入行
- mouseleave: (event) => {}
- },
- };
- },
- // 因为新需要tab标签所以单独写一个总成本的详情,不用原来的
- customCellZcbDetail(record, index, columnValue, columnTitle){
- // 子级总成本不设置弹窗
- if(record.id === 'amount' || (record.ji === 2 && columnValue === 'zcb')){
- return false
- }
- return {
- style: {
- 'color': "#1890ff !important",
- 'cursor': "pointer",
- },
- on: {
- // 点击事件
- click: (event) => {
- },
- // 双击事件
- dblclick: (event) => {
- // console.log(record, index, columnValue, columnTitle)
- var tasknos = record.children.map(item=>item.taskno)
- this.$refs.proCostZcbDetail.taskno = tasknos.join(',')
- this.$refs.proCostZcbDetail.title = columnTitle + '明细'
- this.$refs.proCostZcbDetail.show()
- }
- }
- }
- },
- detailClick(text, record, columnValue, columnTitle){
- if(!this.isClick){
- return
- }
- // console.log(text, record, columnValue, columnTitle)
- // 去掉没有值不弹窗判断 !text ||
- if(record.children || record.id === 'amount'){
- return
- }
- this.$refs.proCostDetail.taskno = record.taskno
- if(record.status === '1' && columnValue === 'clf'){
- // 批产参数
- this.$refs.proCostDetail.pichanInfo = {
- pccode: record.pccode,
- proportion: record.proportion,
- columnValue: columnValue,
- }
- this.$refs.proCostDetail.columnValue = 'pichanTask'
- this.$refs.proCostDetail.title = columnTitle + '批产明细'
- } else {
- this.$refs.proCostDetail.columnValue = columnValue
- this.$refs.proCostDetail.title = columnTitle + '明细'
- }
- this.$refs.proCostDetail.show()
- },
- getClickColumn(record, index){
- if(record.children || record.id === 'amount'){
- return false
- }
- return {
- style: {
- 'color': '#1890ff',
- 'cursor': 'pointer',
- },
- on: {
- click: (event)=> {
- // 没有值不弹窗
- if(!event.target.textContent){
- return
- }
- // console.log(record, index, event, event.target.cellIndex)
- // console.log(this.columns[event.target.cellIndex - 1])
- var clickColumn = this.columns[event.target.cellIndex - 1].dataIndex
- var title = this.columns[event.target.cellIndex - 1].title
- this.$refs.proCostDetail.taskno = record.taskno
- if(record.status === '1'){
- // 批产参数
- this.$refs.proCostDetail.pichanInfo = {
- pccode: record.pccode,
- proportion: record.proportion,
- columnValue: clickColumn,
- }
- this.$refs.proCostDetail.columnValue = 'pichanTask'
- this.$refs.proCostDetail.title = title + '批产明细'
- } else {
- this.$refs.proCostDetail.columnValue = clickColumn
- this.$refs.proCostDetail.title = title + '明细'
- }
- // console.log(this.$refs.proCostDetail.columnValue)
- this.$refs.proCostDetail.show()
- },
- }
- }
- },
- // 费用导入后执行一次计算程序
- handleComputed(){
- this.loading = true
- visibleClientStart().then(response => {
- this.loadData()
- })
- },
- // 比对
- batchDuiBi(){
- // console.log(this.selectedRowKeys,this.selectionRows)
- // console.log(JSON.stringify(this.selectedRowKeys))
- var selectTasknos = this.selectionRows.map( res => {
- var value = res.status === '1' ? res.taskno+'_-_pc' : res.taskno
- return value
- })
- this.duibiTasknos = selectTasknos.toString()
- this.duibiIds = this.selectedRowKeys.toString()
- this.duiBi = true
- // if (this.chooseRowType == 1) {
- // var a = this.selectedRowKeys
- // var ids = a.toString()
- // getHjList({ids: ids}).then((res) => {
- // this.duibiList = res
- // this.duibiclList = []
- // })
- // var selectTasknos = this.selectionRows.map( res => {
- // return res.taskno
- // })
- // var tasknos = selectTasknos.toString()
- // getDbClList({tasknos: tasknos}).then((res) => {
- // this.duibiclList = res.result.resultVOList
- // this.duiBi = true
- // })
- // } else {
- // var a = this.selectedRowKeys
- // var ids = a.toString()
- // getDbList({ids: ids}).then((res) => {
- // this.duibiList = res
- // })
- // var selectTasknos = this.selectionRows.map( res => {
- // return res.taskno
- // })
- // var tasknos = selectTasknos.toString()
- // getDbClList({tasknos: tasknos}).then((res) => {
- // this.duibiclList = res.result.resultVOList
- // this.duiBi = true
- // })
- // }
- // var a = this.selectedRowKeys
- // var ids = a.toString()
- // getDbList({ids: ids}).then((res) => {
- // this.duibiList = res
- // })
- // var selectTasknos = this.selectionRows.map( res => {
- // return res.taskno
- // })
- // var tasknos = selectTasknos.toString()
- // getDbClList({tasknos: tasknos}).then((res) => {
- // this.duibiclList = res
- // this.duiBi = true
- // })
- },
- // 关闭比对弹框
- handleGb(){
- this.duiBi = false
- this.duibiList = {}
- this.duibiclList = []
- },
- // 一键折叠展开
- handleExpand(){
- // console.log(this.isExpanded)
- if(this.isExpanded){
- // 当前为展开,全部折叠
- this.expandedRowKeys = []
- } else {
- // 当前为折叠,全部展开
- this.expandedRowKeys = this.dataSource.map(res => res.id)
- }
- this.isExpanded = !this.isExpanded
- },
- onExpand (expanded, record) {
- if (expanded) {
- // 设置展开窗Key,代表展开操作
- this.expandedRowKeys.push(record.id)
- } else {
- // 代表折叠操作
- if (this.expandedRowKeys.length) {
- this.expandedRowKeys = this.expandedRowKeys.filter(v => {
- return v !== record.id
- })
- }
- }
- },
- // 虚实比对(堆叠图)
- handleXushi(record){
- this.$refs.xushi.open(record)
- },
- // 加入产品模型
- handleAddProjectModel(record){
- var arr = []
- arr.push(record)
- insertIntoProject(arr).then(response => {
- this.loadData()
- })
- },
- // 比对禁选判断
- onSelectChange(selectedRowKeys, selectionRows) {
- // this.selectedRowKeys = selectedRowKeys;
- // this.selectionRows = selectionRows;
- // 解决分页后selectionRows只获取本页面勾选的问题
- for (let val of selectionRows) {
- if (!this.selectionRows.find((item) => item.id === val.id)) {
- this.selectionRows.push(val);
- }
- }
- this.selectedRowKeys = selectedRowKeys;
- this.selectionRows = this.selectionRows.filter((item) =>
- this.selectedRowKeys.includes(item.id)
- );
- },
- onSelect(record, selected, selectedRows, nativeEvent){
- // console.log(record, selected, selectedRows, nativeEvent)
- // console.log(this.selectionRows)
- if(selected) {
- if (this.selectionRows.length == 1) {
- this.chooseRowType = record.ji
- this.chooseStatus = true
- } else {
- // console.log(this.chooseRowType,record.ji)
- if (this.chooseRowType != record.ji) {
- this.chooseRowType = this.chooseRowType
- this.chooseStatus = true
- this.$message.error("请选择同级项进行比对");
- } else{
- // this.chooseStatus = false
- for (let i = 0; i < this.selectionRows.length; i++) {
- const element = this.selectionRows[i].ji;
- if (this.chooseRowType != element) {
- this.chooseStatus = true
- } else {
- this.chooseStatus = false
- }
- }
- }
- }
- } else{
- if (this.selectionRows.length == 1) {
- this.chooseRowType = this.selectionRows[0].ji
- this.chooseStatus = true
- } else {
- for (let i = 0; i < this.selectionRows.length; i++) {
- const element = this.selectionRows[i].ji;
- if (this.chooseRowType != element) {
- this.chooseStatus = true
- this.$message.error("请选择同级项进行比对");
- } else {
- this.chooseStatus = false
- }
- }
- // 第一版
- // if (this.chooseRowType != record.ji) {
- // this.chooseRowType = this.chooseRowType
- // this.chooseStatus = true
- // this.$message.error("请选择同级项进行比对");
- // }else{
- // // this.chooseStatus = false
- // for (let i = 0; i < selectedRows.length; i++) {
- // const element = selectedRows[i].ji;
- // if (this.chooseRowType != element) {
- // this.chooseStatus = true
- // } else {
- // this.chooseStatus = false
- // }
- // }
- // }
- }
- }
- // if (record.ji == '2') {
- // // 选中二级,一级禁选
- // this.chooseRowType == 'chengben'
- // } else {
- // // 选中一级,二级禁选
- // this.chooseRowType == 'huiji'
- // }
- },
- export(value, fileName){
- // if(!fileName || typeof fileName != "string"){
- // fileName = "导出文件"
- // }
- // let param = this.getQueryParams();
- // if(this.selectedRowKeys && this.selectedRowKeys.length>0){
- // param['selections'] = this.selectedRowKeys.join(",")
- // }
- var param = {isFolding: value}
- downFile(this.url.exportXlsUrl,param).then((data)=>{
- // console.log(data)
- if (!data) {
- this.$message.warning("文件下载失败")
- return
- }
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
- }else{
- let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
- let link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- link.setAttribute('download', fileName+'.xls')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link); //下载完成移除元素
- window.URL.revokeObjectURL(url); //释放掉blob对象
- }
- })
- },
- // 导出
- handleExportXls(){
- var isFolding
- var fileName = "项目成本"
- var _this = this
- const modal = this.$confirm({
- title: '请选择导出数据类型',
- content: '*全部数据=汇集层+子级',
- okText: '全部数据',
- // okType: 'danger',
- cancelText: '汇集数据',
- closable: true, // 显示右上角关闭按钮
- onOk() {
- isFolding = 1
- fileName = '项目成本-全部数据'
- _this.export(isFolding, fileName)
- },
- onCancel(e) {
- // console.log(e)
- // 如果是右上角关闭触发,则不导出,只关闭
- if(e.triggerCancel) return
- isFolding = 0
- fileName = '项目成本-汇集数据'
- _this.export(isFolding, fileName)
- modal.destroy();
- },
- });
- },
- getSuperFieldList(){
- let fieldList=[];
- fieldList.push({type:'string',value:'taskno',text:'任务号',dictCode:''})
- fieldList.push({type:'string',value:'taskname',text:'任务名称',dictCode:''})
- fieldList.push({type:'string',value:'xhname',text:'型号',dictCode:''})
- // fieldList.push({type:'date',value:'jhwcsj',text:'计划完成时间'})
- fieldList.push({type:'string',value:'yzjdname',text:'阶段',dictCode:''})
- fieldList.push({type:'string',value:'processpercent',text:'项目进度',dictCode:''})
- fieldList.push({type:'string',value:'costPercent',text:'成本进度',dictCode:''})
- // fieldList.push({type:'int',value:'yzsl',text:'研制数量',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'oneIncome',text:'单台收入',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'oneCost',text:'单台成本',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'oneProfit',text:'单台利润',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'lre',text:'利润额',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'lrl',text:'利润率',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'estimationcoat',text:'预估价',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'contractfpe',text:'合同额',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'taskmoney',text:'已收款',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'zcb',text:'总成本',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'clf',text:'材料费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'zyf',text:'专用费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'swf',text:'事务费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'wxf',text:'外协费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'rldlf',text:'燃料动力费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'gdzczj',text:'固定资产折旧',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'gzjlwf',text:'工资及劳务费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'glf',text:'管理费',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'zjcb',text:'装机成本',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'lbsy',text:'内部试验',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'workhour',text:'工时(h)',dictCode:''})
- fieldList.push({type:'string',value:'zrbm',text:'责任部门',dictCode:''})
- // fieldList.push({type:'int',value:'jycsid',text:'下达部门id',dictCode:''})
- fieldList.push({type:'string',value:'jycs',text:'下达部门',dictCode:''})
- // fieldList.push({type:'int',value:'hxzxid',text:'1:横向 2:纵向/来自科研任务',dictCode:''})
- fieldList.push({type:'string',value:'hxzxname',text:'横向纵向',dictCode:''})
- fieldList.push({type:'string',value:'tasktype',text:'任务类型',dictCode:''})
- // fieldList.push({type:'string',value:'auditprice',text:'审计审价',dictCode:''})
- fieldList.push({type:'string',value:'iflag',text:'任务状态',dictCode:''})
- fieldList.push({type:'string',value:'brief',text:'提出单位简称',dictCode:''})
- fieldList.push({type:'int',value:'reftaskno',text:'父级任务',dictCode:''})
- fieldList.push({type:'int',value:'pccode',text:'批产任务号',dictCode:''})
- // fieldList.push({type:'int',value:'bccode',text:'备产任务号',dictCode:''})
- // fieldList.push({type:'int',value:'blcode',text:'备料任务号',dictCode:''})
- fieldList.push({type:'string',value:'businessman',text:'业务员',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'sjgs',text:'设计工时',dictCode:''})
- // fieldList.push({type:'BigDecimal',value:'scgs',text:'生产工时',dictCode:''})
- this.superFieldList = fieldList
- },
- }
- }
- </script>
- <style scoped>
- @import '~@assets/less/common.less';
- /*表格thead*/
- ::v-deep .ant-table-thead > tr > th {
- font-size: 14px;
- /* color: #000; */
- }
- /*表格tbody*/
- ::v-deep .ant-table-tbody > tr > td {
- font-size: 13px;
- padding: 6px 4px !important;
- }
- </style>
- <style>
- /* 超出预算 */
- .exceed-budget-status{
- color: #ffa300 !important;
- }
- .table-kuisun-color{
- color: red !important;
- /* user-select: 'none'; */
- }
- .table-zupi-color{
- color: #b3b2b2 !important;
- /* user-select: 'none'; */
- }
- .table-chanpin-model-color{
- color: #29d59f !important;
- /* color: #438bf7 !important; */
- }
- </style>
|