ProjectCostList.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. <template>
  2. <a-card :bordered="false">
  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.taskno"></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.taskname"></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.jycs"></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.pccode"></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.bccode"></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.blcode"></a-input>
  86. </a-form-item>
  87. </a-col> -->
  88. </template>
  89. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  90. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  91. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  92. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  93. <a @click="handleToggleSearch" style="margin-left: 8px">
  94. {{ toggleSearchStatus ? '收起' : '展开' }}
  95. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  96. </a>
  97. </span>
  98. </a-col>
  99. </a-row>
  100. </a-form>
  101. </div>
  102. <!-- 查询区域-END -->
  103. <!-- 操作按钮区域 -->
  104. <div class="table-operator">
  105. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  106. <a-button @click="handleExpand" type="primary" icon="column-height">折叠/展开</a-button>
  107. <!-- <a-button type="primary" icon="download" @click="handleExportXls('项目成本')">导出</a-button> -->
  108. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  109. <a-button type="primary" icon="import">导入</a-button>
  110. </a-upload>
  111. <!-- 高级查询区域 -->
  112. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  113. <a-dropdown v-if="selectedRowKeys.length > 0">
  114. <a-menu slot="overlay">
  115. <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>对比</a-menu-item> -->
  116. <a-menu-item key="1" @click="batchDuiBi"><a-icon type="shrink" />对比</a-menu-item>
  117. </a-menu>
  118. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  119. </a-dropdown>
  120. </div>
  121. <!-- table区域-begin -->
  122. <div>
  123. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  124. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  125. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  126. <span style="float:right;">
  127. <a @click="loadData()"><a-icon type="sync" />刷新</a>
  128. <a-divider type="vertical" />
  129. <a-popover title="自定义列" trigger="click" placement="leftBottom">
  130. <template slot="content">
  131. <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
  132. <a-row style="width: 400px">
  133. <template v-for="(item, index) in defColumns">
  134. <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
  135. <a-col :span="12" :key="index">
  136. <a-checkbox :value="item.dataIndex" :disabled="!!item.fixed" :checked="!!item.fixed">
  137. {{ item.title }}</a-checkbox>
  138. </a-col>
  139. </template>
  140. </template>
  141. </a-row>
  142. </a-checkbox-group>
  143. </template>
  144. <a><a-icon type="setting" />自定义列</a>
  145. </a-popover>
  146. </span>
  147. </div>
  148. <a-table
  149. ref="table"
  150. size="middle"
  151. :scroll="{x:true}"
  152. bordered
  153. rowKey="id"
  154. :columns="columns"
  155. :dataSource="dataSource"
  156. :pagination="ipagination"
  157. :loading="loading"
  158. class="j-table-force-nowrap"
  159. :expandedRowKeys="expandedRowKeys"
  160. @expand="onExpand"
  161. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  162. @change="handleTableChange"
  163. :indentSize="12">
  164. <template slot="htmlSlot" slot-scope="text">
  165. <div v-html="text"></div>
  166. </template>
  167. <template slot="imgSlot" slot-scope="text,record">
  168. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  169. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  170. </template>
  171. <template slot="fileSlot" slot-scope="text">
  172. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  173. <a-button
  174. v-else
  175. :ghost="true"
  176. type="primary"
  177. icon="download"
  178. size="small"
  179. @click="downloadFile(text)">
  180. 下载
  181. </a-button>
  182. </template>
  183. <div slot="filterDropdown">
  184. <a-card>
  185. <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
  186. <a-row style="width: 400px">
  187. <template v-for="(item, index) in defColumns">
  188. <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
  189. <a-col :span="12" :key="index"><a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox></a-col>
  190. </template>
  191. </template>
  192. </a-row>
  193. </a-checkbox-group>
  194. </a-card>
  195. </div>
  196. <a-icon slot="filterIcon" type='setting' :style="{ fontSize:'16px',color: '#108ee9' }" />
  197. <span slot="action" slot-scope="text, record">
  198. <!-- <a @click="handleEdit(record)">编辑</a> -->
  199. <a @click="handleDetail(record)">虚实成本</a>
  200. <!-- <a-divider type="vertical" />
  201. <a-dropdown>
  202. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  203. <a-menu slot="overlay">
  204. <a-menu-item>
  205. <a @click="handleDetail(record)">详情</a>
  206. </a-menu-item>
  207. <a-menu-item>
  208. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  209. <a>删除</a>
  210. </a-popconfirm>
  211. </a-menu-item>
  212. </a-menu>
  213. </a-dropdown> -->
  214. </span>
  215. </a-table>
  216. </div>
  217. <project-detail-modal ref="proCostDetail"></project-detail-modal>
  218. <j-modal
  219. :width="1200"
  220. :visible="duiBi"
  221. switchFullscreen
  222. @cancel="handleGb">
  223. <a-tabs default-active-key="1">
  224. <a-tab-pane key="1" tab="总体对比">
  225. <all-list :duibiList="duibiList"></all-list>
  226. </a-tab-pane>
  227. <a-tab-pane key="2" tab="材料费对比" force-render>
  228. <wuliao-list :duibiclList="duibiclList"></wuliao-list>
  229. </a-tab-pane>
  230. </a-tabs>
  231. <template slot="footer">
  232. <a-button @click="handleGb">关闭</a-button>
  233. </template>
  234. </j-modal>
  235. </a-card>
  236. </template>
  237. <script>
  238. import Vue from 'vue'
  239. import { columnsSelect, columnsEdit, proCostYSKdetail, proCostContractdetail, getDbList, getDbClList } from '@/api/kzksApi.js'
  240. import '@/assets/less/TableExpand.less'
  241. import { mixinDevice } from '@/utils/mixin'
  242. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  243. import ProjectDetailModal from './modulesDetail/ProjectDetailModal'
  244. import AllList from '../projectContrastList/allList.vue'
  245. import WuliaoList from '../projectContrastList/wuliaoList.vue'
  246. import { getAction } from '@/api/manage'
  247. export default {
  248. name: 'ProjectCostList',
  249. mixins:[JeecgListMixin, mixinDevice],
  250. components: {
  251. AllList,
  252. WuliaoList,
  253. ProjectDetailModal,
  254. },
  255. data () {
  256. return {
  257. description: '项目成本管理页面',
  258. // 一键折叠/展开
  259. expandedRowKeys: [],
  260. // 是否全部展开
  261. isExpanded: true,
  262. // 获取到的对比数据
  263. duibiList: [],
  264. // 获取到的材料费对比数据
  265. duibiclList: [],
  266. // 对比弹框是否显示
  267. duiBi: false,
  268. // 表头:当前显示的列,初始为全部
  269. columns: [],
  270. //列设置:多选弹窗显示的
  271. settingColumns:[],
  272. //列定义:所有列
  273. defColumns: [
  274. // {
  275. // title: '#',
  276. // dataIndex: '',
  277. // key:'rowIndex',
  278. // width:60,
  279. // align:"center",
  280. // customRender:function (t,r,index) {
  281. // return parseInt(index)+1;
  282. // }
  283. // },
  284. {
  285. title:'任务号',
  286. fixed:"left",
  287. dataIndex: 'taskno',
  288. customHeaderCell:() => ({
  289. style: {
  290. textAlign: 'center', // 表头居中
  291. }
  292. })
  293. },
  294. {
  295. title:'任务名称',
  296. align:"center",
  297. fixed:"left",
  298. dataIndex: 'taskname'
  299. },
  300. {
  301. title:'型号',
  302. align:"center",
  303. dataIndex: 'xhname'
  304. },
  305. {
  306. title:'计划完成时间',
  307. align:"center",
  308. dataIndex: 'jhwcsj',
  309. customRender:function (text) {
  310. return !text?"":(text.length>10?text.substr(0,10):text)
  311. }
  312. },
  313. {
  314. title:'阶段',
  315. align:"center",
  316. dataIndex: 'yzjdname'
  317. },
  318. {
  319. title:'项目进度',
  320. align:"center",
  321. dataIndex: 'processpercent'
  322. },
  323. {
  324. title:'成本进度',
  325. align:"center",
  326. dataIndex: 'costPercent'
  327. },
  328. {
  329. title:'研制数量',
  330. align:"center",
  331. dataIndex: 'yzsl'
  332. },
  333. {
  334. title:'单台收入',
  335. align:"center",
  336. dataIndex: 'oneIncome'
  337. },
  338. {
  339. title:'单台成本',
  340. align:"center",
  341. dataIndex: 'oneCost'
  342. },
  343. {
  344. title:'单台利润',
  345. align:"center",
  346. dataIndex: 'oneProfit'
  347. },
  348. {
  349. title:'利润额',
  350. align:"center",
  351. dataIndex: 'lre'
  352. },
  353. {
  354. title:'利润率',
  355. align:"center",
  356. dataIndex: 'lrl'
  357. },
  358. {
  359. title:'预估价',
  360. align:"center",
  361. dataIndex: 'estimationcoat'
  362. },
  363. {
  364. title:'合同额',
  365. align:"center",
  366. dataIndex: 'contractfpe',
  367. customCell: this.getClickColumn,
  368. },
  369. {
  370. title:'已收款',
  371. align:"center",
  372. dataIndex: 'taskmoney',
  373. customCell: this.getClickColumn,
  374. },
  375. {
  376. title:'总成本',
  377. align:"center",
  378. dataIndex: 'zcb'
  379. },
  380. {
  381. title:'材料费',
  382. align:"center",
  383. dataIndex: 'clf',
  384. customCell: this.getClickColumn,
  385. },
  386. {
  387. title:'专用费',
  388. align:"center",
  389. dataIndex: 'zyf',
  390. customCell: this.getClickColumn,
  391. },
  392. {
  393. title:'事务费',
  394. align:"center",
  395. dataIndex: 'swf',
  396. customCell: this.getClickColumn,
  397. },
  398. {
  399. title:'外协费',
  400. align:"center",
  401. dataIndex: 'wxf',
  402. customCell: this.getClickColumn,
  403. },
  404. {
  405. title:'燃料动力费',
  406. align:"center",
  407. dataIndex: 'rldlf'
  408. },
  409. {
  410. title:'固定资产折旧',
  411. align:"center",
  412. dataIndex: 'gdzczj'
  413. },
  414. {
  415. title:'工资及劳务费',
  416. align:"center",
  417. dataIndex: 'gzjlwf'
  418. },
  419. {
  420. title:'管理费',
  421. align:"center",
  422. dataIndex: 'glf'
  423. },
  424. {
  425. title:'装机成本',
  426. align:"center",
  427. dataIndex: 'zjcb',
  428. customCell: this.getClickColumn,
  429. },
  430. {
  431. title:'内部试验',
  432. align:"center",
  433. dataIndex: 'lbsy'
  434. },
  435. {
  436. title:'工时(h)',
  437. align:"center",
  438. dataIndex: 'workhour',
  439. customCell: this.getClickColumn,
  440. },
  441. {
  442. title:'责任部门',
  443. align:"center",
  444. dataIndex: 'zrbm'
  445. },
  446. // {
  447. // title:'下达部门id',
  448. // align:"center",
  449. // dataIndex: 'jycsid'
  450. // },
  451. {
  452. title:'下达部门',
  453. align:"center",
  454. dataIndex: 'jycs'
  455. },
  456. // {
  457. // title:'1:横向 2:纵向',
  458. // align:"center",
  459. // dataIndex: 'hxzxid'
  460. // },
  461. {
  462. title:'横向纵向',
  463. align:"center",
  464. dataIndex: 'hxzxname'
  465. },
  466. {
  467. title:'任务类型',
  468. align:"center",
  469. dataIndex: 'tasktype'
  470. },
  471. {
  472. title:'审计审价',
  473. align:"center",
  474. dataIndex: 'auditprice'
  475. },
  476. {
  477. title:'任务状态',
  478. align:"center",
  479. dataIndex: 'iflag'
  480. },
  481. {
  482. title:'提出单位简称',
  483. align:"center",
  484. dataIndex: 'brief'
  485. },
  486. {
  487. title:'父级任务',
  488. align:"center",
  489. dataIndex: 'reftaskno'
  490. },
  491. {
  492. title:'批产任务号',
  493. align:"center",
  494. dataIndex: 'pccode'
  495. },
  496. {
  497. title:'备产任务号',
  498. align:"center",
  499. dataIndex: 'bccode'
  500. },
  501. {
  502. title:'备料任务号',
  503. align:"center",
  504. dataIndex: 'blcode'
  505. },
  506. {
  507. title:'业务员',
  508. align:"center",
  509. dataIndex: 'businessman'
  510. },
  511. {
  512. title:'设计工时',
  513. align:"center",
  514. dataIndex: 'sjgs'
  515. },
  516. {
  517. title:'生产工时',
  518. align:"center",
  519. dataIndex: 'scgs'
  520. },
  521. {
  522. title: '操作',
  523. dataIndex: 'action',
  524. align:"center",
  525. fixed:"right",
  526. width:147,
  527. scopedSlots: {
  528. filterDropdown: 'filterDropdown',
  529. filterIcon: 'filterIcon',
  530. customRender: 'action',
  531. }
  532. }
  533. ],
  534. url: {
  535. list: "/projectCostHuiji/projectCostHuiji/list",
  536. // delete: "/projectCost/projectCost/delete",
  537. // deleteBatch: "/projectCost/projectCost/deleteBatch",
  538. exportXlsUrl: "/projectCostHuiji/projectCostHuiji/exportXls",
  539. importExcelUrl: "projectCost/projectCost/importExcel",
  540. },
  541. dictOptions:{},
  542. superFieldList:[],
  543. }
  544. },
  545. created() {
  546. this.initColumns();
  547. this.loadData()
  548. this.getSuperFieldList();
  549. },
  550. computed: {
  551. importExcelUrl: function(){
  552. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  553. },
  554. },
  555. methods: {
  556. loadData(arg) {
  557. if(!this.url.list){
  558. this.$message.error("请设置url.list属性!")
  559. return
  560. }
  561. //加载数据 若传入参数1则加载第一页的内容
  562. if (arg === 1) {
  563. this.ipagination.current = 1;
  564. }
  565. var params = this.getQueryParams();//查询条件
  566. this.loading = true;
  567. getAction(this.url.list, params).then((res) => {
  568. if (res.success) {
  569. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  570. this.dataSource = res.result.records||res.result;
  571. if(res.result.total)
  572. {
  573. this.ipagination.total = res.result.total;
  574. }else{
  575. this.ipagination.total = 0;
  576. }
  577. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  578. this.setDefaultExpand()
  579. }else{
  580. this.$message.warning(res.message)
  581. }
  582. }).finally(() => {
  583. this.loading = false
  584. })
  585. },
  586. initDictConfig(){
  587. },
  588. getSuperFieldList(){
  589. let fieldList=[];
  590. fieldList.push({type:'string',value:'taskno',text:'任务号',dictCode:''})
  591. fieldList.push({type:'string',value:'taskname',text:'任务名称',dictCode:''})
  592. fieldList.push({type:'string',value:'xhname',text:'型号',dictCode:''})
  593. fieldList.push({type:'date',value:'jhwcsj',text:'计划完成时间'})
  594. fieldList.push({type:'string',value:'yzjdname',text:'阶段',dictCode:''})
  595. fieldList.push({type:'string',value:'processpercent',text:'项目进度',dictCode:''})
  596. fieldList.push({type:'string',value:'costPercent',text:'成本进度',dictCode:''})
  597. fieldList.push({type:'int',value:'yzsl',text:'研制数量',dictCode:''})
  598. fieldList.push({type:'BigDecimal',value:'oneIncome',text:'单台收入',dictCode:''})
  599. fieldList.push({type:'BigDecimal',value:'oneCost',text:'单台成本',dictCode:''})
  600. fieldList.push({type:'BigDecimal',value:'oneProfit',text:'单台利润',dictCode:''})
  601. fieldList.push({type:'BigDecimal',value:'lre',text:'利润额',dictCode:''})
  602. fieldList.push({type:'BigDecimal',value:'lrl',text:'利润率',dictCode:''})
  603. fieldList.push({type:'BigDecimal',value:'estimationcoat',text:'预估价',dictCode:''})
  604. fieldList.push({type:'BigDecimal',value:'contractfpe',text:'合同额',dictCode:''})
  605. fieldList.push({type:'BigDecimal',value:'taskmoney',text:'已收款',dictCode:''})
  606. fieldList.push({type:'BigDecimal',value:'zcb',text:'总成本',dictCode:''})
  607. fieldList.push({type:'BigDecimal',value:'clf',text:'材料费',dictCode:''})
  608. fieldList.push({type:'BigDecimal',value:'zyf',text:'专用费',dictCode:''})
  609. fieldList.push({type:'BigDecimal',value:'swf',text:'事务费',dictCode:''})
  610. fieldList.push({type:'BigDecimal',value:'wxf',text:'外协费',dictCode:''})
  611. fieldList.push({type:'BigDecimal',value:'rldlf',text:'燃料动力费',dictCode:''})
  612. fieldList.push({type:'BigDecimal',value:'gdzczj',text:'固定资产折旧',dictCode:''})
  613. fieldList.push({type:'BigDecimal',value:'gzjlwf',text:'工资及劳务费',dictCode:''})
  614. fieldList.push({type:'BigDecimal',value:'glf',text:'管理费',dictCode:''})
  615. fieldList.push({type:'BigDecimal',value:'zjcb',text:'装机成本',dictCode:''})
  616. fieldList.push({type:'BigDecimal',value:'lbsy',text:'内部试验',dictCode:''})
  617. fieldList.push({type:'BigDecimal',value:'workhour',text:'工时(h)',dictCode:''})
  618. fieldList.push({type:'string',value:'zrbm',text:'责任部门',dictCode:''})
  619. fieldList.push({type:'int',value:'jycsid',text:'下达部门id',dictCode:''})
  620. fieldList.push({type:'string',value:'jycs',text:'下达部门',dictCode:''})
  621. // fieldList.push({type:'int',value:'hxzxid',text:'1:横向 2:纵向/来自科研任务',dictCode:''})
  622. fieldList.push({type:'string',value:'hxzxname',text:'横向纵向',dictCode:''})
  623. fieldList.push({type:'string',value:'tasktype',text:'任务类型',dictCode:''})
  624. fieldList.push({type:'string',value:'auditprice',text:'审计审价',dictCode:''})
  625. fieldList.push({type:'string',value:'iflag',text:'任务状态',dictCode:''})
  626. fieldList.push({type:'string',value:'brief',text:'提出单位简称',dictCode:''})
  627. fieldList.push({type:'int',value:'reftaskno',text:'父级任务',dictCode:''})
  628. fieldList.push({type:'int',value:'pccode',text:'批产任务号',dictCode:''})
  629. fieldList.push({type:'int',value:'bccode',text:'备产任务号',dictCode:''})
  630. fieldList.push({type:'int',value:'blcode',text:'备料任务号',dictCode:''})
  631. fieldList.push({type:'string',value:'businessman',text:'业务员',dictCode:''})
  632. fieldList.push({type:'BigDecimal',value:'sjgs',text:'设计工时',dictCode:''})
  633. fieldList.push({type:'BigDecimal',value:'scgs',text:'生产工时',dictCode:''})
  634. this.superFieldList = fieldList
  635. },
  636. initColumns(){
  637. //权限过滤(列权限控制时打开,修改第二个参数为授权码前缀)
  638. //this.defColumns = colAuthFilter(this.defColumns,'testdemo:');
  639. columnsSelect().then(res => {
  640. let colSettings = res
  641. console.log(colSettings)
  642. if(colSettings==null||colSettings==undefined){
  643. let allSettingColumns = [];
  644. this.defColumns.forEach(function (item,i,array ) {
  645. allSettingColumns.push(item.dataIndex);
  646. })
  647. this.settingColumns = allSettingColumns;
  648. this.columns = this.defColumns;
  649. }else{
  650. this.settingColumns = colSettings;
  651. const cols = this.defColumns.filter(item => {
  652. if(item.key =='rowIndex'|| item.dataIndex=='action'){
  653. return true;
  654. }
  655. if (colSettings.includes(item.dataIndex)) {
  656. return true;
  657. }
  658. return false;
  659. })
  660. this.columns = cols;
  661. }
  662. })
  663. // 储存浏览器方式
  664. // var key = this.$route.name+":colsettings";
  665. // let colSettings= Vue.ls.get(key);
  666. },
  667. //列设置更改事件
  668. onColSettingsChange (checkedValues) {
  669. console.log(checkedValues)
  670. // 获取浏览器方式
  671. // var key = this.$route.name+":colsettings";
  672. // Vue.ls.set(key, checkedValues, 7 * 24 * 60 * 60 * 1000)
  673. this.settingColumns = checkedValues;
  674. const cols = this.defColumns.filter(item => {
  675. if(item.key =='rowIndex'|| item.dataIndex=='action'){
  676. return true
  677. }
  678. if (this.settingColumns.includes(item.dataIndex)) {
  679. return true
  680. }
  681. return false
  682. })
  683. this.columns = cols;
  684. columnsEdit({checkedValues: checkedValues})
  685. },
  686. getClickColumn(record, index){
  687. if(record.children){
  688. return false
  689. }
  690. return {
  691. style: {
  692. 'color': '#1890ff',
  693. 'cursor': 'pointer',
  694. },
  695. on: {
  696. click: (event)=> {
  697. // 没有值不弹窗
  698. if(!event.target.textContent){
  699. return
  700. }
  701. // console.log(record, index, event, event.target.cellIndex)
  702. console.log(this.columns[event.target.cellIndex - 1])
  703. var clickColumn = this.columns[event.target.cellIndex - 1].dataIndex
  704. var title = this.columns[event.target.cellIndex - 1].title
  705. this.$refs.proCostDetail.taskno = record.taskno
  706. this.$refs.proCostDetail.columnValue = clickColumn
  707. this.$refs.proCostDetail.title = title + '明细'
  708. this.$refs.proCostDetail.show()
  709. }
  710. }
  711. }
  712. },
  713. // 对比
  714. batchDuiBi(){
  715. console.log(this.selectedRowKeys,this.selectionRows)
  716. // console.log(JSON.stringify(this.selectedRowKeys))
  717. var a = this.selectedRowKeys
  718. var ids = a.toString()
  719. getDbList({ids: ids}).then((res) => {
  720. console.log(res)
  721. this.duibiList = res
  722. })
  723. var selectTasknos = this.selectionRows.map( res => {
  724. return res.taskno
  725. })
  726. var tasknos = selectTasknos.toString()
  727. console.log(tasknos)
  728. getDbClList({tasknos: tasknos}).then((res) => {
  729. console.log(res)
  730. this.duibiclList = res
  731. this.duiBi = true
  732. })
  733. },
  734. // 关闭对比弹框
  735. handleGb(){
  736. this.duiBi = false
  737. this.duibiList = []
  738. this.duibiclList = []
  739. },
  740. // 一键折叠展开
  741. handleExpand(){
  742. console.log(this.isExpanded)
  743. if(this.isExpanded){
  744. // 当前为展开,全部折叠
  745. this.expandedRowKeys = []
  746. } else {
  747. // 当前为折叠,全部展开
  748. this.setDefaultExpand()
  749. }
  750. this.isExpanded = !this.isExpanded
  751. },
  752. // 全部展开
  753. setDefaultExpand(){
  754. this.expandedRowKeys = this.dataSource.map(res => res.id)
  755. },
  756. onExpand (expanded, record) {
  757. if (expanded) {
  758. console.log(record.id)
  759. // 设置展开窗Key,代表展开操作
  760. this.expandedRowKeys.push(record.id)
  761. } else {
  762. // 代表折叠操作
  763. if (this.expandedRowKeys.length) {
  764. this.expandedRowKeys = this.expandedRowKeys.filter(v => {
  765. return v !== record.id
  766. })
  767. }
  768. }
  769. },
  770. }
  771. }
  772. </script>
  773. <style scoped>
  774. @import '~@assets/less/common.less';
  775. </style>