ProjectCostList.vue 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504
  1. <template>
  2. <a-card :bordered="false" style="overflow: hidden;">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="任务名称">
  9. <a-input placeholder="请输入任务名称" v-model="queryParam.taskname"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="任务号">
  14. <a-input placeholder="请输入任务号" v-model="queryParam.taskno"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="型号">
  20. <a-input placeholder="请输入型号" v-model="queryParam.xhname"></a-input>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="阶段">
  25. <a-input placeholder="请输入阶段" v-model="queryParam.yzjdname"></a-input>
  26. </a-form-item>
  27. </a-col> -->
  28. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  29. <a-form-item label="计划完成时间">
  30. <j-date placeholder="请选择计划完成时间" v-model="queryParam.jhwcsj"></j-date>
  31. </a-form-item>
  32. </a-col> -->
  33. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  34. <a-form-item label="任务类型">
  35. <a-input placeholder="请输入任务类型" v-model="queryParam.tasktype"></a-input>
  36. </a-form-item>
  37. </a-col> -->
  38. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  39. <a-form-item label="审计审价">
  40. <a-input placeholder="请输入审计审价" v-model="queryParam.auditprice"></a-input>
  41. </a-form-item>
  42. </a-col>
  43. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  44. <a-form-item label="任务状态">
  45. <a-input placeholder="请输入任务状态" v-model="queryParam.iflag"></a-input>
  46. </a-form-item>
  47. </a-col> -->
  48. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  49. <a-form-item label="项目进度">
  50. <a-input placeholder="请输入项目进度" v-model="queryParam.processpercent"></a-input>
  51. </a-form-item>
  52. </a-col> -->
  53. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  54. <a-form-item label="成本进度">
  55. <a-input placeholder="请输入成本进度" v-model="queryParam.costPercent"></a-input>
  56. </a-form-item>
  57. </a-col> -->
  58. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  59. <a-form-item label="业务员">
  60. <a-input placeholder="请输入业务员" v-model="queryParam.businessman"></a-input>
  61. </a-form-item>
  62. </a-col> -->
  63. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  64. <a-form-item label="下达部门id">
  65. <a-input placeholder="请输入下达部门id" v-model="queryParam.jycsid"></a-input>
  66. </a-form-item>
  67. </a-col> -->
  68. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  69. <a-form-item label="项目进度">
  70. <a-input placeholder="请输入项目进度" v-model="queryParam.processpercent"></a-input>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  74. <a-form-item label="下达部门">
  75. <a-input placeholder="请输入下达部门" v-model="queryParam.jycs"></a-input>
  76. </a-form-item>
  77. </a-col>
  78. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  79. <a-form-item label="责任部门">
  80. <a-input placeholder="请输入责任部门" v-model="queryParam.zrbm"></a-input>
  81. </a-form-item>
  82. </a-col>
  83. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  84. <a-form-item label="批产任务号">
  85. <a-input placeholder="请输入批产任务号" v-model="queryParam.pccode"></a-input>
  86. </a-form-item>
  87. </a-col> -->
  88. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  89. <a-form-item label="备产任务号">
  90. <a-input placeholder="请输入备产任务号" v-model="queryParam.bccode"></a-input>
  91. </a-form-item>
  92. </a-col>
  93. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  94. <a-form-item label="备料任务号">
  95. <a-input placeholder="请输入备料任务号" v-model="queryParam.blcode"></a-input>
  96. </a-form-item>
  97. </a-col> -->
  98. </template>
  99. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  100. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  101. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  102. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  103. <a @click="handleToggleSearch" style="margin-left: 8px">
  104. {{ toggleSearchStatus ? '收起' : '展开' }}
  105. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  106. </a>
  107. </span>
  108. </a-col>
  109. </a-row>
  110. </a-form>
  111. </div>
  112. <!-- 查询区域-END -->
  113. <!-- 操作按钮区域 -->
  114. <div class="table-operator">
  115. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  116. <a-button @click="handleExpand" type="primary" icon="column-height">折叠/展开</a-button>
  117. <a-button @click="handleAdd" type="primary" icon="plus">导入</a-button>
  118. <a-button @click="handleComputed" type="primary" icon="reconciliation">计算</a-button>
  119. <a-button type="primary" icon="download" @click="handleExportXls()">导出</a-button>
  120. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  121. <a-button type="primary" icon="import">导入</a-button>
  122. </a-upload> -->
  123. <!-- 高级查询区域 -->
  124. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  125. <a-button @click="batchDuiBi" :disabled="chooseStatus"><a-icon type="shrink" />比对</a-button>
  126. <!-- <a-dropdown v-if="selectedRowKeys.length > 0"> -->
  127. <!-- <a-menu slot="overlay"> -->
  128. <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>比对</a-menu-item> -->
  129. <!-- <a-menu-item key="1" @click="batchDuiBi"><a-icon type="shrink" />比对</a-menu-item>
  130. </a-menu>
  131. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> -->
  132. <!-- </a-dropdown> -->
  133. </div>
  134. <!-- table区域-begin -->
  135. <div>
  136. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  137. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  138. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  139. <span style="margin-left: 40px; color: #b5b5b5;">*红色表示亏损;绿色表示加入至产品价格库;灰色表示解组批后;*</span>
  140. <span style="float:right;">
  141. <a @click="loadData()"><a-icon type="sync" />刷新</a>
  142. <a-divider type="vertical" />
  143. <a-popover title="自定义列" trigger="click" placement="leftBottom">
  144. <template slot="content">
  145. <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
  146. <a-row style="width: 400px">
  147. <template v-for="(item, index) in defColumns">
  148. <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
  149. <a-col :span="12" :key="index">
  150. <a-checkbox :value="item.dataIndex" :disabled="!!item.fixed" :checked="!!item.fixed">
  151. {{ item.title }}</a-checkbox>
  152. </a-col>
  153. </template>
  154. </template>
  155. </a-row>
  156. </a-checkbox-group>
  157. </template>
  158. <a><a-icon type="setting" />自定义列</a>
  159. </a-popover>
  160. </span>
  161. </div>
  162. <a-table
  163. ref="table"
  164. size="middle"
  165. :scroll="{x:true,}"
  166. bordered
  167. rowKey="id"
  168. :columns="columns"
  169. :dataSource="dataSource"
  170. :pagination="ipagination"
  171. :loading="loading"
  172. class="j-table-force-nowrap"
  173. :expandedRowKeys="expandedRowKeys"
  174. @expand="onExpand"
  175. @mousedown.native="mouseDownHandler"
  176. @mouseup.native="mouseUpHandler"
  177. @mousemove.native="mouseMoveHandler"
  178. :rowClassName="setRowClassName"
  179. :rowSelection="{
  180. selectedRowKeys: selectedRowKeys,
  181. onChange: onSelectChange,
  182. onSelect: onSelect,
  183. getCheckboxProps: (record) => ({
  184. props: {
  185. //disabled: record.id == 'amount', // 禁选的条件为:合计行不可选
  186. disabled: record.id == 'amount' ||
  187. (record.ji== '1' && chooseRowType == 'huiji') ||
  188. (record.ji== '2' && chooseRowType == 'chengben')
  189. },
  190. }),}"
  191. @change="handleTableChange"
  192. :indentSize="12">
  193. <template slot="htmlSlot" slot-scope="text">
  194. <div v-html="text"></div>
  195. </template>
  196. <template slot="imgSlot" slot-scope="text,record">
  197. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  198. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  199. </template>
  200. <template slot="fileSlot" slot-scope="text">
  201. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  202. <a-button
  203. v-else
  204. :ghost="true"
  205. type="primary"
  206. icon="download"
  207. size="small"
  208. @click="downloadFile(text)">
  209. 下载
  210. </a-button>
  211. </template>
  212. <div slot="filterDropdown">
  213. <a-card>
  214. <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
  215. <a-row style="width: 400px">
  216. <template v-for="(item, index) in defColumns">
  217. <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
  218. <a-col :span="12" :key="index"><a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox></a-col>
  219. </template>
  220. </template>
  221. </a-row>
  222. </a-checkbox-group>
  223. </a-card>
  224. </div>
  225. <a-icon slot="filterIcon" type='setting' :style="{ fontSize:'16px',color: '#108ee9' }" />
  226. <!-- <span slot="contractfpe" slot-scope="text, record">
  227. <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>
  228. </span> -->
  229. <!-- <span slot="taskmoney" slot-scope="text, record">
  230. <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>
  231. </span> -->
  232. <!-- <span slot="clf" slot-scope="text, record">
  233. <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>
  234. </span> -->
  235. <!-- <span slot="zyf" slot-scope="text, record">
  236. <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>
  237. </span> -->
  238. <!-- <span slot="swf" slot-scope="text, record">
  239. <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>
  240. </span> -->
  241. <!-- <span slot="wxf" slot-scope="text, record">
  242. <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>
  243. </span>
  244. <span slot="zjcb" slot-scope="text, record">
  245. <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>
  246. </span>
  247. <span slot="workhour" slot-scope="text, record">
  248. <a-button type="link" @click="detailClick(text,record,'workhour','工时')" :style="{color: (record.children || record.id === 'amount') ? 'rgba(0,0,0,.65)' : ''}">{{text}}</a-button>
  249. </span> -->
  250. <span slot="action" slot-scope="text, record">
  251. <!-- <a @click="handleEdit(record)">编辑</a> -->
  252. <!-- <a-tooltip v-if="record.id !== 'amount' && record.ji === 1">
  253. <template slot="title">
  254. 汇集层无预算执行
  255. </template>
  256. <span style="color: rgba(0,0,0,.25);">预算执行</span>
  257. </a-tooltip> -->
  258. <a @click="handleXushi(record)" v-if="record.id !== 'amount'">预算执行</a>
  259. <!-- <a @click="handleXushi(record)" v-if="record.id !== 'amount'" :disabled="record.ji === 1">预算执行</a> -->
  260. <a-divider v-if="record.id !== 'amount' && record.ji === 1" type="vertical" />
  261. <a @click="handleAddProjectModel(record)" v-if="record.id !== 'amount' && record.ji === 1" :disabled="record.hjstatus === '4'">加入产品</a>
  262. <!-- <a-dropdown>
  263. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  264. <a-menu slot="overlay">
  265. <a-menu-item>
  266. <a @click="handleDetail(record)">详情</a>
  267. </a-menu-item>
  268. <a-menu-item>
  269. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  270. <a>删除</a>
  271. </a-popconfirm>
  272. </a-menu-item>
  273. </a-menu>
  274. </a-dropdown> -->
  275. </span>
  276. </a-table>
  277. </div>
  278. <project-detail-modal ref="proCostDetail"></project-detail-modal>
  279. <j-modal
  280. :width="1200"
  281. :visible="duiBi"
  282. switchFullscreen
  283. @cancel="handleGb">
  284. <a-tabs default-active-key="1">
  285. <a-tab-pane key="1" tab="总体比对">
  286. <all-list :duibiIds="duibiIds" :chooseRowType="chooseRowType"></all-list>
  287. <!-- <all-list :duibiList="duibiList"></all-list> -->
  288. </a-tab-pane>
  289. <a-tab-pane key="2" tab="材料费比对" force-render>
  290. <wuliao-list :chooseRowType="chooseRowType" :duibiTasknos="duibiTasknos" ></wuliao-list>
  291. <!-- <wuliao-list :duibiclList="duibiclList"></wuliao-list> -->
  292. </a-tab-pane>
  293. </a-tabs>
  294. <template slot="footer">
  295. <a-button @click="handleGb">关闭</a-button>
  296. </template>
  297. </j-modal>
  298. <!-- 虚实成本比对(堆叠图) -->
  299. <contrast-modal ref="xushi"></contrast-modal>
  300. <!-- 导入弹框 -->
  301. <project-import-list-modal ref="modalForm" @ok="modalFormOk" :isAllShow="false"></project-import-list-modal>
  302. </a-card>
  303. </template>
  304. <script>
  305. import Vue from 'vue';
  306. // import VueDraggableResizable from 'vue-draggable-resizable';
  307. // Vue.component('vue-draggable-resizable', VueDraggableResizable);
  308. import { columnsSelect, columnsEdit, proCostYSKdetail, proCostContractdetail, getDbList, getHjList, getDbClList, insertIntoProject, visibleClientStart } from '@/api/kzksApi.js'
  309. import '@/assets/less/TableExpand.less'
  310. import { mixinDevice } from '@/utils/mixin'
  311. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  312. import ProjectDetailModal from './modulesDetail/ProjectDetailModal'
  313. import AllList from '../projectContrastList/allList.vue'
  314. import WuliaoList from '../projectContrastList/wuliaoList.vue'
  315. import { getAction, downFile } from '@/api/manage'
  316. import ContrastModal from '../projectXushiContrast/contrastModal.vue'
  317. import ProjectImportListModal from '../projectImportList/modules/ProjectImportListModal.vue'
  318. import { number } from 'echarts';
  319. export default {
  320. name: 'ProjectCostList',
  321. mixins:[JeecgListMixin, mixinDevice],
  322. components: {
  323. AllList,
  324. WuliaoList,
  325. ProjectDetailModal,
  326. ContrastModal,
  327. ProjectImportListModal,
  328. },
  329. data () {
  330. return {
  331. scrollHeight: 700,
  332. /* 分页参数 */
  333. ipagination:{
  334. current: 1,
  335. pageSize: 11, // 设置a-table调用时加上筛选行
  336. pageSizeOptions: ['11', '21', '31'],
  337. showTotal: (total, range) => {
  338. // console.log(total, range, this.ipagination.current)
  339. var current = this.ipagination.current
  340. if(this.showListTotal){
  341. return (range[0] - current + 1) + "-" + (range[1] - current) + " 共" + this.showListTotal + "条"
  342. } else {
  343. return range[0] + "-" + range[1] + " 共" + total + "条"
  344. }
  345. },
  346. showQuickJumper: true,
  347. showSizeChanger: true,
  348. total: 0,
  349. // 显示时减去筛选行
  350. buildOptionText: (size) => {
  351. return new Number(size.value) - 1 + '条/页'
  352. }
  353. },
  354. // 用来前端显示出去筛选行的total
  355. showListTotal: 0,
  356. description: '项目成本管理页面',
  357. // 一键折叠/展开
  358. expandedRowKeys: [],
  359. // 是否全部展开
  360. isExpanded: false,
  361. // 获取比对级
  362. chooseRowType: undefined,
  363. // 比对状态
  364. chooseStatus: true,
  365. // 获取到的比对数据
  366. duibiList: {},
  367. // 获取到的材料费比对数据
  368. duibiclList: [],
  369. // 比对弹框是否显示
  370. duiBi: false,
  371. // 表头:当前显示的列,初始为全部
  372. columns: [],
  373. //列设置:多选弹窗显示的
  374. settingColumns:[],
  375. //列定义:所有列
  376. defColumns: [
  377. // {
  378. // title: '#',
  379. // dataIndex: '',
  380. // key:'rowIndex',
  381. // width:60,
  382. // align:"center",
  383. // customRender:function (t,r,index) {
  384. // return parseInt(index)+1;
  385. // }
  386. // },
  387. {
  388. title:'任务号',
  389. fixed:"left",
  390. dataIndex: 'taskno',
  391. width: 120,
  392. customHeaderCell:() => ({
  393. style: {
  394. textAlign: 'center', // 表头居中
  395. }
  396. })
  397. },
  398. {
  399. title:'任务名称',
  400. align:"center",
  401. fixed:"left",
  402. width: 120,
  403. dataIndex: 'taskname',
  404. ellipsis: true,
  405. },
  406. {
  407. title:'型号',
  408. align:"center",
  409. width: 120,
  410. dataIndex: 'xhname',
  411. },
  412. {
  413. title:'计划完成时间',
  414. align:"center",
  415. width: 120,
  416. dataIndex: 'jhwcsj',
  417. customRender:function (text) {
  418. return !text?"":(text.length>10?text.substr(0,10):text)
  419. }
  420. },
  421. {
  422. title:'阶段',
  423. align:"center",
  424. width: 80,
  425. dataIndex: 'yzjdname'
  426. },
  427. {
  428. title:'项目进度',
  429. align:"center",
  430. width: 80,
  431. dataIndex: 'processpercent',
  432. customRender: (text, record) => {
  433. return record.id === 'amount'?null:parseInt(text)+ '%'
  434. },
  435. },
  436. {
  437. title:'成本进度',
  438. align:"center",
  439. width: 80,
  440. dataIndex: 'costPercent',
  441. customRender: (text, record) => {
  442. return record.id === 'amount'?null:(Number(text) * 100).toFixed(0) + '%'
  443. },
  444. },
  445. {
  446. title:'已收款',
  447. align:"center",
  448. width: 80,
  449. dataIndex: 'taskmoney',
  450. // scopedSlots: {
  451. // customRender: 'taskmoney',
  452. // },
  453. customRender: (text) => {
  454. return (Number(text)/10000).toFixed(2)
  455. },
  456. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'taskmoney', '已收款')}
  457. },
  458. {
  459. title:'合同额',
  460. align:"center",
  461. width: 80,
  462. dataIndex: 'contractfpe',
  463. // scopedSlots: {
  464. // customRender: 'contractfpe',
  465. // },
  466. // customCell: this.getClickColumn,
  467. customRender: (text) => {
  468. return (Number(text)/10000).toFixed(2)
  469. },
  470. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'contractfpe', '合同额')}
  471. },
  472. {
  473. title:'预估价',
  474. align:"center",
  475. width: 80,
  476. dataIndex: 'estimationcoat',
  477. customRender: (text, record) => {
  478. return record.contractfpe ? '-' : Number(text).toFixed(2)
  479. },
  480. },
  481. {
  482. title:'总成本',
  483. align:"center",
  484. width: 80,
  485. dataIndex: 'zcb',
  486. customRender: (text) => {
  487. return (Number(text)/10000).toFixed(2)
  488. },
  489. },
  490. {
  491. title:'利润额',
  492. align:"center",
  493. width: 80,
  494. dataIndex: 'lre',
  495. customRender: (text) => {
  496. return (Number(text)/10000).toFixed(2)
  497. },
  498. },
  499. {
  500. title:'利润率',
  501. align:"center",
  502. width: 80,
  503. dataIndex: 'lrl',
  504. customRender: (text) => {
  505. return (Number(text) * 100).toFixed(1) + '%'
  506. },
  507. },
  508. {
  509. title:'研制数量',
  510. align:"center",
  511. width: 80,
  512. dataIndex: 'yzsl'
  513. },
  514. {
  515. title:'单台利润',
  516. align:"center",
  517. width: 80,
  518. dataIndex: 'oneProfit',
  519. customRender: (text, record) => {
  520. return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
  521. },
  522. },
  523. {
  524. title:'单台收入',
  525. align:"center",
  526. width: 80,
  527. dataIndex: 'oneIncome',
  528. customRender: (text, record) => {
  529. return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
  530. },
  531. },
  532. {
  533. title:'单台成本',
  534. align:"center",
  535. width: 80,
  536. dataIndex: 'oneCost',
  537. customRender: (text, record) => {
  538. return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
  539. },
  540. },
  541. {
  542. title:'材料预算',
  543. align:"center",
  544. width: 80,
  545. dataIndex: 'clys',
  546. customRender: (text) => {
  547. return Number(text).toFixed(2)
  548. },
  549. },
  550. {
  551. title:'材料费',
  552. align:"center",
  553. width: 80,
  554. dataIndex: 'clf',
  555. // scopedSlots: {
  556. // customRender: 'clf',
  557. // },
  558. customRender: (text) => {
  559. return (Number(text)/10000).toFixed(2)
  560. },
  561. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'clf', '材料费')}
  562. },
  563. {
  564. title:'专用预算',
  565. align:"center",
  566. width: 80,
  567. dataIndex: 'zyys',
  568. customRender: (text) => {
  569. return Number(text).toFixed(2)
  570. },
  571. },
  572. {
  573. title:'专用费',
  574. align:"center",
  575. width: 80,
  576. dataIndex: 'zyf',
  577. // scopedSlots: {
  578. // customRender: 'zyf',
  579. // },
  580. customRender: (text) => {
  581. return (Number(text)/10000).toFixed(2)
  582. },
  583. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'zyf', '专用费')}
  584. },
  585. {
  586. title:'事务预算',
  587. align:"center",
  588. width: 80,
  589. dataIndex: 'swys',
  590. customRender: (text) => {
  591. return Number(text).toFixed(2)
  592. },
  593. },
  594. {
  595. title:'事务费',
  596. align:"center",
  597. width: 80,
  598. dataIndex: 'swf',
  599. // scopedSlots: {
  600. // customRender: 'swf',
  601. // },
  602. customRender: (text) => {
  603. return (Number(text)/10000).toFixed(2)
  604. },
  605. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'swf', '事务费')}
  606. },
  607. {
  608. title:'外协预算',
  609. align:"center",
  610. width: 80,
  611. dataIndex: 'wxys',
  612. customRender: (text) => {
  613. return Number(text).toFixed(2)
  614. },
  615. },
  616. {
  617. title:'外协费',
  618. align:"center",
  619. width: 80,
  620. dataIndex: 'wxf',
  621. // scopedSlots: {
  622. // customRender: 'wxf',
  623. // },
  624. customRender: (text) => {
  625. return (Number(text)/10000).toFixed(2)
  626. },
  627. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'wxf', '外协费')}
  628. },
  629. {
  630. title:'间接预算',
  631. align:"center",
  632. width: 80,
  633. dataIndex: 'jjys',
  634. customRender: (text) => {
  635. return Number(text).toFixed(2)
  636. },
  637. },
  638. {
  639. title:'燃动费',
  640. align:"center",
  641. width: 80,
  642. dataIndex: 'rldlf',
  643. customRender: (text) => {
  644. return (Number(text)/10000).toFixed(2)
  645. },
  646. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'rldlf', '燃动费')}
  647. },
  648. {
  649. title:'固资费',
  650. align:"center",
  651. width: 80,
  652. dataIndex: 'gdzczj',
  653. customRender: (text) => {
  654. return (Number(text)/10000).toFixed(2)
  655. },
  656. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'gdzczj', '固资费')}
  657. },
  658. {
  659. title:'人工费',
  660. align:"center",
  661. width: 80,
  662. dataIndex: 'gzjlwf',
  663. customRender: (text) => {
  664. return (Number(text)/10000).toFixed(2)
  665. },
  666. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'gzjlwf', '人工费')}
  667. },
  668. {
  669. title:'管理费',
  670. align:"center",
  671. width: 80,
  672. dataIndex: 'glf',
  673. customRender: (text) => {
  674. return (Number(text)/10000).toFixed(2)
  675. },
  676. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'glf', '管理费')}
  677. },
  678. {
  679. title:'筛选费',
  680. align:"center",
  681. width: 80,
  682. dataIndex: 'sxf',
  683. customRender: (text) => {
  684. return (Number(text)/10000).toFixed(2)
  685. },
  686. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'sxf', '筛选费')}
  687. },
  688. {
  689. title:'装机成本',
  690. align:"center",
  691. width: 80,
  692. dataIndex: 'zjcb',
  693. // scopedSlots: {
  694. // customRender: 'zjcb',
  695. // },
  696. customRender: (text) => {
  697. return (Number(text)/10000).toFixed(2)
  698. },
  699. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'zjcb', '装机成本')}
  700. },
  701. {
  702. title:'内部试验',
  703. align:"center",
  704. width: 80,
  705. dataIndex: 'lbsy',
  706. ellipsis: true,
  707. },
  708. {
  709. title:'工时(h)',
  710. align:"center",
  711. width: 80,
  712. dataIndex: 'workhour',
  713. // scopedSlots: {
  714. // customRender: 'workhour',
  715. // },
  716. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'workhour', '工时')}
  717. },
  718. {
  719. title:'责任部门',
  720. align:"center",
  721. width: 120,
  722. dataIndex: 'zrbm',
  723. ellipsis: true,
  724. },
  725. // {
  726. // title:'下达部门id',
  727. // align:"center",
  728. // dataIndex: 'jycsid'
  729. // },
  730. {
  731. title:'下达部门',
  732. align:"center",
  733. width: 120,
  734. dataIndex: 'jycs',
  735. ellipsis: true,
  736. },
  737. // {
  738. // title:'1:横向 2:纵向',
  739. // align:"center",
  740. // dataIndex: 'hxzxid'
  741. // },
  742. {
  743. title:'横向纵向',
  744. align:"center",
  745. width: 80,
  746. dataIndex: 'hxzxname'
  747. },
  748. {
  749. title:'任务类型',
  750. align:"center",
  751. width: 80,
  752. dataIndex: 'tasktype'
  753. },
  754. {
  755. title:'审计审价',
  756. align:"center",
  757. width: 80,
  758. dataIndex: 'auditprice'
  759. },
  760. {
  761. title:'任务状态',
  762. align:"center",
  763. width: 80,
  764. dataIndex: 'iflag'
  765. },
  766. {
  767. title:'提出单位简称',
  768. align:"center",
  769. width: 120,
  770. dataIndex: 'brief'
  771. },
  772. {
  773. title:'父级任务',
  774. align:"center",
  775. width: 80,
  776. dataIndex: 'reftaskno'
  777. },
  778. {
  779. title:'批产任务号',
  780. align:"center",
  781. width: 80,
  782. dataIndex: 'pccode'
  783. },
  784. {
  785. title:'备产任务号',
  786. align:"center",
  787. width: 80,
  788. dataIndex: 'bccode'
  789. },
  790. {
  791. title:'备料任务号',
  792. align:"center",
  793. width: 80,
  794. dataIndex: 'blcode'
  795. },
  796. {
  797. title:'业务员',
  798. align:"center",
  799. width: 80,
  800. dataIndex: 'businessManName',
  801. ellipsis: true,
  802. },
  803. {
  804. title:'主管设计师',
  805. align:"center",
  806. width: 100,
  807. dataIndex: 'ywfzrname',
  808. ellipsis: true,
  809. },
  810. {
  811. title:'科研任务负责人',
  812. align:"center",
  813. width: 120,
  814. dataIndex: 'xhzzrname',
  815. ellipsis: true,
  816. },
  817. {
  818. title:'设计工时',
  819. align:"center",
  820. width: 80,
  821. dataIndex: 'sjgs'
  822. },
  823. {
  824. title:'生产工时',
  825. align:"center",
  826. width: 80,
  827. dataIndex: 'scgs'
  828. },
  829. // {
  830. // title:'级别',
  831. // align:"center",
  832. // dataIndex: 'ji',
  833. // customCell: this.getClickColumn,
  834. // },
  835. {
  836. title: '操作',
  837. dataIndex: 'action',
  838. align:"center",
  839. fixed:"right",
  840. width: 150,
  841. scopedSlots: {
  842. // filterDropdown: 'filterDropdown',
  843. // filterIcon: 'filterIcon',
  844. customRender: 'action',
  845. }
  846. }
  847. ],
  848. url: {
  849. list: "/projectCostHuiji/projectCostHuiji/list",
  850. // delete: "/projectCost/projectCost/delete",
  851. // deleteBatch: "/projectCost/projectCost/deleteBatch",
  852. exportXlsUrl: "/projectCostHuiji/projectCostHuiji/exportXlsProjectCost",
  853. importExcelUrl: "projectCost/projectCost/importExcel",
  854. },
  855. dictOptions:{},
  856. superFieldList:[],
  857. // 拖拽
  858. handlerFirstTime: null,
  859. isClick: false,
  860. mouseFlag: false,
  861. mouseOffset: null,
  862. // 比对
  863. duibiIds: '',
  864. duibiTasknos: '',
  865. }
  866. },
  867. created() {
  868. this.loadData()
  869. this.initColumns();
  870. this.getSuperFieldList();
  871. },
  872. mounted() {
  873. console.log(window.innerHeight, this.$refs.table)
  874. this.$nextTick(() => {
  875. this.scrollHeight = window.innerHeight - 60 - 25 - 55 - 25
  876. // this.scrollHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 60 - 52 - 50 - 56 - 60 - 34
  877. })
  878. },
  879. computed: {
  880. importExcelUrl: function(){
  881. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  882. },
  883. },
  884. methods: {
  885. // 按下鼠标记录鼠标位置
  886. mouseDownHandler(e) {
  887. this.mouseOffset = e.clientX;
  888. this.handlerFirstTime = new Date().getTime()
  889. this.mouseFlag = true;
  890. console.log(this.mouseOffset)
  891. },
  892. mouseUpHandler(e) {
  893. var lastTime = new Date().getTime();
  894. this.mouseFlag = false;
  895. if( (lastTime - this.handlerFirstTime) < 100){
  896. this.isClick = true
  897. } else {
  898. this.isClick = false
  899. }
  900. },
  901. mouseMoveHandler(e) {
  902. // 这里面需要注意,通过ref需要那个那个包含table元素的父元素
  903. let v=document.getElementsByClassName("ant-table-body")[0]
  904. v.style.cursor = 'move'
  905. v.style['user-select'] = 'none'
  906. if (this.mouseFlag) {
  907. // 设置水平方向的元素的位置
  908. v.scrollLeft -= (- this.mouseOffset + (this.mouseOffset = e.clientX));
  909. }
  910. },
  911. loadData(arg) {
  912. console.log(111)
  913. if(!this.url.list){
  914. this.$message.error("请设置url.list属性!")
  915. return
  916. }
  917. //加载数据 若传入参数1则加载第一页的内容
  918. if (arg === 1) {
  919. this.ipagination.current = 1;
  920. }
  921. var params = this.getQueryParams();//查询条件
  922. console.log(params)
  923. // 查询时减去筛选行
  924. params.pageSize = (Number(params.pageSize) - 1).toString()
  925. this.loading = true;
  926. getAction(this.url.list, params).then((res) => {
  927. console.log(res)
  928. if (res.success) {
  929. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  930. this.dataSource = res.result.pageList.records||res.result.pageList;
  931. var amount = res.result.projectCostHuiji
  932. amount.taskno = '筛选合计:'
  933. amount.id = 'amount'
  934. // amount.id = 'amount'+res.result.pageList.current
  935. this.dataSource.unshift(amount)
  936. if(res.result.pageList.total)
  937. {
  938. // 解决页数显示不对的问题:因为a-table当前默认是加上筛选行的,合计时几页就加上几
  939. // 例如:当前total后端返回32,一页10个应该是4页,但是a-table调用的是一页11个,所以32/11 会显示3页
  940. this.ipagination.total = res.result.pageList.total + res.result.pageList.pages;
  941. // 设置显示的total数
  942. this.showListTotal = res.result.pageList.total
  943. }else{
  944. this.ipagination.total = 0;
  945. }
  946. console.log(this.dataSource)
  947. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  948. }else{
  949. this.$message.warning(res.message)
  950. }
  951. }).finally(() => {
  952. this.loading = false
  953. })
  954. },
  955. initDictConfig(){
  956. },
  957. initColumns(){
  958. //权限过滤(列权限控制时打开,修改第二个参数为授权码前缀)
  959. // this.defColumns = colAuthFilter(this.defColumns,'testdemo:');
  960. columnsSelect().then(res => {
  961. let colSettings = res
  962. if(colSettings==null||colSettings==undefined || colSettings.length === 0){
  963. let allSettingColumns = [];
  964. this.defColumns.forEach(function (item,i,array ) {
  965. allSettingColumns.push(item.dataIndex);
  966. })
  967. this.settingColumns = allSettingColumns;
  968. this.columns = this.defColumns;
  969. }else{
  970. this.settingColumns = colSettings;
  971. const cols = this.defColumns.filter(item => {
  972. if(item.key =='rowIndex'|| item.dataIndex=='action'){
  973. return true;
  974. }
  975. if (colSettings.includes(item.dataIndex)) {
  976. return true;
  977. }
  978. return false;
  979. })
  980. this.columns = cols;
  981. }
  982. })
  983. // 储存浏览器方式
  984. // var key = this.$route.name+":colsettings";
  985. // let colSettings= Vue.ls.get(key);
  986. },
  987. // 行颜色设置
  988. setRowClassName(record, index){
  989. // console.log(record)
  990. if(record.lrl < 0){
  991. // 亏损标红
  992. return 'table-kuisun-color'
  993. }
  994. if(record.status === '1'){
  995. // 汇集计算之后的数据标浅灰
  996. return 'table-zupi-color'
  997. }
  998. if(record.hjstatus === '4'){
  999. // 加入产品价格库的
  1000. return 'table-chanpin-model-color'
  1001. }
  1002. },
  1003. //列设置更改事件
  1004. onColSettingsChange (checkedValues) {
  1005. console.log(checkedValues)
  1006. // 获取浏览器方式
  1007. // var key = this.$route.name+":colsettings";
  1008. // Vue.ls.set(key, checkedValues, 7 * 24 * 60 * 60 * 1000)
  1009. this.settingColumns = checkedValues;
  1010. const cols = this.defColumns.filter(item => {
  1011. if(item.key =='rowIndex'|| item.dataIndex=='action'){
  1012. return true
  1013. }
  1014. if (this.settingColumns.includes(item.dataIndex)) {
  1015. return true
  1016. }
  1017. return false
  1018. })
  1019. this.columns = cols;
  1020. columnsEdit({checkedValues: checkedValues})
  1021. },
  1022. customCellDetail(record, index, columnValue, columnTitle){
  1023. if(record.children || record.id === 'amount'){
  1024. return false
  1025. }
  1026. console.log(record, index, columnValue, columnTitle)
  1027. return {
  1028. style: {
  1029. 'color': "#1890ff !important",
  1030. 'cursor': "pointer",
  1031. },
  1032. on: {
  1033. // 点击事件
  1034. click: (event) => {
  1035. },
  1036. dblclick: (event) => {
  1037. // 没有值不弹窗--也弹窗
  1038. // if(!event.target.textContent){
  1039. // return
  1040. // }
  1041. this.$refs.proCostDetail.taskno = record.taskno
  1042. if(record.status === '1' && columnValue === 'clf'){
  1043. // 批产参数
  1044. this.$refs.proCostDetail.pichanInfo = {
  1045. pccode: record.pccode,
  1046. proportion: record.proportion,
  1047. columnValue: columnValue,
  1048. }
  1049. console.log(columnValue)
  1050. this.$refs.proCostDetail.columnValue = 'pichanTask'
  1051. this.$refs.proCostDetail.title = columnTitle + '批产明细'
  1052. } else {
  1053. this.$refs.proCostDetail.columnValue = columnValue
  1054. this.$refs.proCostDetail.title = columnTitle + '明细'
  1055. }
  1056. this.$refs.proCostDetail.show()
  1057. },
  1058. contextmenu: (event) => {},
  1059. mouseenter: (event) => {}, // 鼠标移入行
  1060. mouseleave: (event) => {}
  1061. },
  1062. };
  1063. },
  1064. detailClick(text, record, columnValue, columnTitle){
  1065. if(!this.isClick){
  1066. return
  1067. }
  1068. // console.log(text, record, columnValue, columnTitle)
  1069. // 去掉没有值不弹窗判断 !text ||
  1070. if(record.children || record.id === 'amount'){
  1071. return
  1072. }
  1073. this.$refs.proCostDetail.taskno = record.taskno
  1074. if(record.status === '1' && columnValue === 'clf'){
  1075. // 批产参数
  1076. this.$refs.proCostDetail.pichanInfo = {
  1077. pccode: record.pccode,
  1078. proportion: record.proportion,
  1079. columnValue: columnValue,
  1080. }
  1081. console.log(columnValue)
  1082. this.$refs.proCostDetail.columnValue = 'pichanTask'
  1083. this.$refs.proCostDetail.title = columnTitle + '批产明细'
  1084. } else {
  1085. this.$refs.proCostDetail.columnValue = columnValue
  1086. this.$refs.proCostDetail.title = columnTitle + '明细'
  1087. }
  1088. this.$refs.proCostDetail.show()
  1089. },
  1090. getClickColumn(record, index){
  1091. if(record.children || record.id === 'amount'){
  1092. return false
  1093. }
  1094. return {
  1095. style: {
  1096. 'color': '#1890ff',
  1097. 'cursor': 'pointer',
  1098. },
  1099. on: {
  1100. click: (event)=> {
  1101. // 没有值不弹窗
  1102. if(!event.target.textContent){
  1103. return
  1104. }
  1105. // console.log(record, index, event, event.target.cellIndex)
  1106. // console.log(this.columns[event.target.cellIndex - 1])
  1107. var clickColumn = this.columns[event.target.cellIndex - 1].dataIndex
  1108. var title = this.columns[event.target.cellIndex - 1].title
  1109. this.$refs.proCostDetail.taskno = record.taskno
  1110. if(record.status === '1'){
  1111. // 批产参数
  1112. this.$refs.proCostDetail.pichanInfo = {
  1113. pccode: record.pccode,
  1114. proportion: record.proportion,
  1115. columnValue: clickColumn,
  1116. }
  1117. this.$refs.proCostDetail.columnValue = 'pichanTask'
  1118. this.$refs.proCostDetail.title = title + '批产明细'
  1119. } else {
  1120. this.$refs.proCostDetail.columnValue = clickColumn
  1121. this.$refs.proCostDetail.title = title + '明细'
  1122. }
  1123. // console.log(this.$refs.proCostDetail.columnValue)
  1124. this.$refs.proCostDetail.show()
  1125. },
  1126. }
  1127. }
  1128. },
  1129. // 费用导入后执行一次计算程序
  1130. handleComputed(){
  1131. this.loading = true
  1132. visibleClientStart().then(response => {
  1133. console.log(response)
  1134. this.loadData()
  1135. })
  1136. },
  1137. // 比对
  1138. batchDuiBi(){
  1139. // console.log(this.selectedRowKeys,this.selectionRows)
  1140. // console.log(JSON.stringify(this.selectedRowKeys))
  1141. var selectTasknos = this.selectionRows.map( res => {
  1142. console.log(res.status)
  1143. var value = res.status === '1' ? res.taskno+'_-_pc' : res.taskno
  1144. return value
  1145. })
  1146. console.log(selectTasknos)
  1147. this.duibiTasknos = selectTasknos.toString()
  1148. this.duibiIds = this.selectedRowKeys.toString()
  1149. this.duiBi = true
  1150. // if (this.chooseRowType == 1) {
  1151. // var a = this.selectedRowKeys
  1152. // var ids = a.toString()
  1153. // getHjList({ids: ids}).then((res) => {
  1154. // console.log(res)
  1155. // this.duibiList = res
  1156. // this.duibiclList = []
  1157. // })
  1158. // var selectTasknos = this.selectionRows.map( res => {
  1159. // return res.taskno
  1160. // })
  1161. // var tasknos = selectTasknos.toString()
  1162. // console.log(tasknos)
  1163. // getDbClList({tasknos: tasknos}).then((res) => {
  1164. // console.log(res)
  1165. // this.duibiclList = res.result.resultVOList
  1166. // this.duiBi = true
  1167. // })
  1168. // } else {
  1169. // var a = this.selectedRowKeys
  1170. // var ids = a.toString()
  1171. // getDbList({ids: ids}).then((res) => {
  1172. // console.log(res)
  1173. // this.duibiList = res
  1174. // })
  1175. // var selectTasknos = this.selectionRows.map( res => {
  1176. // return res.taskno
  1177. // })
  1178. // var tasknos = selectTasknos.toString()
  1179. // console.log(tasknos)
  1180. // getDbClList({tasknos: tasknos}).then((res) => {
  1181. // console.log(res)
  1182. // this.duibiclList = res.result.resultVOList
  1183. // this.duiBi = true
  1184. // })
  1185. // }
  1186. // var a = this.selectedRowKeys
  1187. // var ids = a.toString()
  1188. // getDbList({ids: ids}).then((res) => {
  1189. // console.log(res)
  1190. // this.duibiList = res
  1191. // })
  1192. // var selectTasknos = this.selectionRows.map( res => {
  1193. // return res.taskno
  1194. // })
  1195. // var tasknos = selectTasknos.toString()
  1196. // console.log(tasknos)
  1197. // getDbClList({tasknos: tasknos}).then((res) => {
  1198. // console.log(res)
  1199. // this.duibiclList = res
  1200. // this.duiBi = true
  1201. // })
  1202. },
  1203. // 关闭比对弹框
  1204. handleGb(){
  1205. this.duiBi = false
  1206. this.duibiList = {}
  1207. this.duibiclList = []
  1208. },
  1209. // 一键折叠展开
  1210. handleExpand(){
  1211. console.log(this.isExpanded)
  1212. if(this.isExpanded){
  1213. // 当前为展开,全部折叠
  1214. this.expandedRowKeys = []
  1215. } else {
  1216. // 当前为折叠,全部展开
  1217. this.expandedRowKeys = this.dataSource.map(res => res.id)
  1218. }
  1219. this.isExpanded = !this.isExpanded
  1220. },
  1221. onExpand (expanded, record) {
  1222. if (expanded) {
  1223. console.log(record.id)
  1224. // 设置展开窗Key,代表展开操作
  1225. this.expandedRowKeys.push(record.id)
  1226. } else {
  1227. // 代表折叠操作
  1228. if (this.expandedRowKeys.length) {
  1229. this.expandedRowKeys = this.expandedRowKeys.filter(v => {
  1230. return v !== record.id
  1231. })
  1232. }
  1233. }
  1234. },
  1235. // 虚实比对(堆叠图)
  1236. handleXushi(record){
  1237. console.log(record)
  1238. this.$refs.xushi.open(record)
  1239. },
  1240. // 加入产品模型
  1241. handleAddProjectModel(record){
  1242. console.log(record)
  1243. var arr = []
  1244. arr.push(record)
  1245. insertIntoProject(arr).then(response => {
  1246. console.log(response)
  1247. this.loadData()
  1248. })
  1249. },
  1250. // 比对禁选判断
  1251. onSelectChange(selectedRowKeys, selectionRows) {
  1252. console.log(selectedRowKeys, selectionRows)
  1253. // this.selectedRowKeys = selectedRowKeys;
  1254. // this.selectionRows = selectionRows;
  1255. // 解决分页后selectionRows只获取本页面勾选的问题
  1256. for (let val of selectionRows) {
  1257. if (!this.selectionRows.find((item) => item.id === val.id)) {
  1258. this.selectionRows.push(val);
  1259. }
  1260. }
  1261. this.selectedRowKeys = selectedRowKeys;
  1262. this.selectionRows = this.selectionRows.filter((item) =>
  1263. this.selectedRowKeys.includes(item.id)
  1264. );
  1265. },
  1266. onSelect(record, selected, selectedRows, nativeEvent){
  1267. console.log(record, selected, selectedRows, nativeEvent)
  1268. console.log(this.selectionRows)
  1269. if(selected) {
  1270. if (this.selectionRows.length == 1) {
  1271. this.chooseRowType = record.ji
  1272. this.chooseStatus = true
  1273. } else {
  1274. console.log(this.chooseRowType,record.ji)
  1275. if (this.chooseRowType != record.ji) {
  1276. this.chooseRowType = this.chooseRowType
  1277. this.chooseStatus = true
  1278. this.$message.error("请选择同级项进行比对");
  1279. } else{
  1280. // this.chooseStatus = false
  1281. for (let i = 0; i < this.selectionRows.length; i++) {
  1282. const element = this.selectionRows[i].ji;
  1283. console.log(888,this.chooseRowType,element)
  1284. if (this.chooseRowType != element) {
  1285. this.chooseStatus = true
  1286. } else {
  1287. this.chooseStatus = false
  1288. }
  1289. }
  1290. }
  1291. }
  1292. } else{
  1293. if (this.selectionRows.length == 1) {
  1294. console.log(777,this.selectionRows[0].ji)
  1295. this.chooseRowType = this.selectionRows[0].ji
  1296. this.chooseStatus = true
  1297. } else {
  1298. for (let i = 0; i < this.selectionRows.length; i++) {
  1299. const element = this.selectionRows[i].ji;
  1300. console.log(888,this.chooseRowType,element)
  1301. if (this.chooseRowType != element) {
  1302. this.chooseStatus = true
  1303. this.$message.error("请选择同级项进行比对");
  1304. } else {
  1305. this.chooseStatus = false
  1306. }
  1307. }
  1308. // 第一版
  1309. // if (this.chooseRowType != record.ji) {
  1310. // this.chooseRowType = this.chooseRowType
  1311. // this.chooseStatus = true
  1312. // this.$message.error("请选择同级项进行比对");
  1313. // }else{
  1314. // // this.chooseStatus = false
  1315. // for (let i = 0; i < selectedRows.length; i++) {
  1316. // const element = selectedRows[i].ji;
  1317. // console.log(888,this.chooseRowType,element)
  1318. // if (this.chooseRowType != element) {
  1319. // this.chooseStatus = true
  1320. // } else {
  1321. // this.chooseStatus = false
  1322. // }
  1323. // }
  1324. // }
  1325. }
  1326. }
  1327. // console.log(record.ji)
  1328. // if (record.ji == '2') {
  1329. // // 选中二级,一级禁选
  1330. // this.chooseRowType == 'chengben'
  1331. // } else {
  1332. // // 选中一级,二级禁选
  1333. // this.chooseRowType == 'huiji'
  1334. // }
  1335. },
  1336. export(value, fileName){
  1337. // if(!fileName || typeof fileName != "string"){
  1338. // fileName = "导出文件"
  1339. // }
  1340. // let param = this.getQueryParams();
  1341. // if(this.selectedRowKeys && this.selectedRowKeys.length>0){
  1342. // param['selections'] = this.selectedRowKeys.join(",")
  1343. // }
  1344. // console.log("导出参数",param)
  1345. var param = {isFolding: value}
  1346. downFile(this.url.exportXlsUrl,param).then((data)=>{
  1347. console.log(data)
  1348. if (!data) {
  1349. this.$message.warning("文件下载失败")
  1350. return
  1351. }
  1352. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  1353. window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
  1354. }else{
  1355. let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
  1356. let link = document.createElement('a')
  1357. link.style.display = 'none'
  1358. link.href = url
  1359. link.setAttribute('download', fileName+'.xls')
  1360. document.body.appendChild(link)
  1361. link.click()
  1362. document.body.removeChild(link); //下载完成移除元素
  1363. window.URL.revokeObjectURL(url); //释放掉blob对象
  1364. }
  1365. })
  1366. },
  1367. // 导出
  1368. handleExportXls(){
  1369. var isFolding
  1370. var fileName = "项目成本"
  1371. var _this = this
  1372. const modal = this.$confirm({
  1373. title: '请选择导出数据类型',
  1374. content: '*全部数据=汇集层+子级',
  1375. okText: '全部数据',
  1376. // okType: 'danger',
  1377. cancelText: '汇集数据',
  1378. closable: true, // 显示右上角关闭按钮
  1379. onOk() {
  1380. isFolding = 1
  1381. fileName = '项目成本-全部数据'
  1382. _this.export(isFolding, fileName)
  1383. },
  1384. onCancel(e) {
  1385. // console.log(e)
  1386. // 如果是右上角关闭触发,则不导出,只关闭
  1387. if(e.triggerCancel) return
  1388. isFolding = 0
  1389. fileName = '项目成本-汇集数据'
  1390. _this.export(isFolding, fileName)
  1391. modal.destroy();
  1392. },
  1393. });
  1394. },
  1395. getSuperFieldList(){
  1396. let fieldList=[];
  1397. fieldList.push({type:'string',value:'taskno',text:'任务号',dictCode:''})
  1398. fieldList.push({type:'string',value:'taskname',text:'任务名称',dictCode:''})
  1399. fieldList.push({type:'string',value:'xhname',text:'型号',dictCode:''})
  1400. // fieldList.push({type:'date',value:'jhwcsj',text:'计划完成时间'})
  1401. fieldList.push({type:'string',value:'yzjdname',text:'阶段',dictCode:''})
  1402. fieldList.push({type:'string',value:'processpercent',text:'项目进度',dictCode:''})
  1403. fieldList.push({type:'string',value:'costPercent',text:'成本进度',dictCode:''})
  1404. // fieldList.push({type:'int',value:'yzsl',text:'研制数量',dictCode:''})
  1405. // fieldList.push({type:'BigDecimal',value:'oneIncome',text:'单台收入',dictCode:''})
  1406. // fieldList.push({type:'BigDecimal',value:'oneCost',text:'单台成本',dictCode:''})
  1407. // fieldList.push({type:'BigDecimal',value:'oneProfit',text:'单台利润',dictCode:''})
  1408. // fieldList.push({type:'BigDecimal',value:'lre',text:'利润额',dictCode:''})
  1409. // fieldList.push({type:'BigDecimal',value:'lrl',text:'利润率',dictCode:''})
  1410. // fieldList.push({type:'BigDecimal',value:'estimationcoat',text:'预估价',dictCode:''})
  1411. // fieldList.push({type:'BigDecimal',value:'contractfpe',text:'合同额',dictCode:''})
  1412. // fieldList.push({type:'BigDecimal',value:'taskmoney',text:'已收款',dictCode:''})
  1413. // fieldList.push({type:'BigDecimal',value:'zcb',text:'总成本',dictCode:''})
  1414. // fieldList.push({type:'BigDecimal',value:'clf',text:'材料费',dictCode:''})
  1415. // fieldList.push({type:'BigDecimal',value:'zyf',text:'专用费',dictCode:''})
  1416. // fieldList.push({type:'BigDecimal',value:'swf',text:'事务费',dictCode:''})
  1417. // fieldList.push({type:'BigDecimal',value:'wxf',text:'外协费',dictCode:''})
  1418. // fieldList.push({type:'BigDecimal',value:'rldlf',text:'燃料动力费',dictCode:''})
  1419. // fieldList.push({type:'BigDecimal',value:'gdzczj',text:'固定资产折旧',dictCode:''})
  1420. // fieldList.push({type:'BigDecimal',value:'gzjlwf',text:'工资及劳务费',dictCode:''})
  1421. // fieldList.push({type:'BigDecimal',value:'glf',text:'管理费',dictCode:''})
  1422. // fieldList.push({type:'BigDecimal',value:'zjcb',text:'装机成本',dictCode:''})
  1423. // fieldList.push({type:'BigDecimal',value:'lbsy',text:'内部试验',dictCode:''})
  1424. // fieldList.push({type:'BigDecimal',value:'workhour',text:'工时(h)',dictCode:''})
  1425. fieldList.push({type:'string',value:'zrbm',text:'责任部门',dictCode:''})
  1426. // fieldList.push({type:'int',value:'jycsid',text:'下达部门id',dictCode:''})
  1427. fieldList.push({type:'string',value:'jycs',text:'下达部门',dictCode:''})
  1428. // fieldList.push({type:'int',value:'hxzxid',text:'1:横向 2:纵向/来自科研任务',dictCode:''})
  1429. fieldList.push({type:'string',value:'hxzxname',text:'横向纵向',dictCode:''})
  1430. fieldList.push({type:'string',value:'tasktype',text:'任务类型',dictCode:''})
  1431. // fieldList.push({type:'string',value:'auditprice',text:'审计审价',dictCode:''})
  1432. fieldList.push({type:'string',value:'iflag',text:'任务状态',dictCode:''})
  1433. fieldList.push({type:'string',value:'brief',text:'提出单位简称',dictCode:''})
  1434. fieldList.push({type:'int',value:'reftaskno',text:'父级任务',dictCode:''})
  1435. fieldList.push({type:'int',value:'pccode',text:'批产任务号',dictCode:''})
  1436. // fieldList.push({type:'int',value:'bccode',text:'备产任务号',dictCode:''})
  1437. // fieldList.push({type:'int',value:'blcode',text:'备料任务号',dictCode:''})
  1438. fieldList.push({type:'string',value:'businessman',text:'业务员',dictCode:''})
  1439. // fieldList.push({type:'BigDecimal',value:'sjgs',text:'设计工时',dictCode:''})
  1440. // fieldList.push({type:'BigDecimal',value:'scgs',text:'生产工时',dictCode:''})
  1441. this.superFieldList = fieldList
  1442. },
  1443. }
  1444. }
  1445. </script>
  1446. <style scoped>
  1447. @import '~@assets/less/common.less';
  1448. </style>
  1449. <style scoped>
  1450. .table-kuisun-color{
  1451. color: red !important;
  1452. /* user-select: 'none'; */
  1453. }
  1454. .table-zupi-color{
  1455. color: #b3b2b2 !important;
  1456. /* user-select: 'none'; */
  1457. }
  1458. .table-chanpin-model-color{
  1459. color: #29d59f !important;
  1460. /* color: #438bf7 !important; */
  1461. }
  1462. /*表格thead*/
  1463. ::v-deep .ant-table-thead > tr > th {
  1464. font-size: 14px;
  1465. /* color: #000; */
  1466. }
  1467. /*表格tbody*/
  1468. ::v-deep .ant-table-tbody > tr > td {
  1469. font-size: 13px;
  1470. padding: 6px 4px !important;
  1471. }
  1472. </style>