ProjectCostList.vue 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  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. <!-- 详情弹窗 -->
  279. <project-detail-modal ref="proCostDetail"></project-detail-modal>
  280. <!-- 总成本弹窗 -->
  281. <project-zcb-detail-modal ref="proCostZcbDetail"></project-zcb-detail-modal>
  282. <j-modal
  283. :width="1200"
  284. :visible="duiBi"
  285. switchFullscreen
  286. @cancel="handleGb">
  287. <a-tabs default-active-key="1">
  288. <a-tab-pane key="1" tab="总体比对">
  289. <all-list :duibiIds="duibiIds" :chooseRowType="chooseRowType"></all-list>
  290. <!-- <all-list :duibiList="duibiList"></all-list> -->
  291. </a-tab-pane>
  292. <a-tab-pane key="2" tab="材料费比对" force-render>
  293. <wuliao-list :chooseRowType="chooseRowType" :duibiTasknos="duibiTasknos" ></wuliao-list>
  294. <!-- <wuliao-list :duibiclList="duibiclList"></wuliao-list> -->
  295. </a-tab-pane>
  296. </a-tabs>
  297. <template slot="footer">
  298. <a-button @click="handleGb">关闭</a-button>
  299. </template>
  300. </j-modal>
  301. <!-- 虚实成本比对(堆叠图) -->
  302. <contrast-modal ref="xushi"></contrast-modal>
  303. <!-- 导入弹框 -->
  304. <project-import-list-modal ref="modalForm" @ok="modalFormOk" :isAllShow="false"></project-import-list-modal>
  305. </a-card>
  306. </template>
  307. <script>
  308. import Vue from 'vue';
  309. // import VueDraggableResizable from 'vue-draggable-resizable';
  310. // Vue.component('vue-draggable-resizable', VueDraggableResizable);
  311. import { columnsSelect, columnsEdit, proCostYSKdetail, proCostContractdetail, getDbList, getHjList, getDbClList, insertIntoProject, visibleClientStart } from '@/api/kzksApi.js'
  312. import '@/assets/less/TableExpand.less'
  313. import { mixinDevice } from '@/utils/mixin'
  314. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  315. import ProjectDetailModal from './modulesDetail/ProjectDetailModal'
  316. import ProjectZcbDetailModal from './modulesDetail/ProjectZcbDetailModal'
  317. import AllList from '../projectContrastList/allList.vue'
  318. import WuliaoList from '../projectContrastList/wuliaoList.vue'
  319. import { getAction, downFile } from '@/api/manage'
  320. import ContrastModal from '../projectXushiContrast/contrastModal.vue'
  321. import ProjectImportListModal from '../projectImportList/modules/ProjectImportListModal.vue'
  322. import { number } from 'echarts';
  323. export default {
  324. name: 'ProjectCostList',
  325. mixins:[JeecgListMixin, mixinDevice],
  326. components: {
  327. AllList,
  328. WuliaoList,
  329. ProjectDetailModal,
  330. ProjectZcbDetailModal,
  331. ContrastModal,
  332. ProjectImportListModal,
  333. },
  334. data () {
  335. return {
  336. scrollHeight: 700,
  337. /* 分页参数 */
  338. ipagination:{
  339. current: 1,
  340. pageSize: 11, // 设置a-table调用时加上筛选行
  341. pageSizeOptions: ['11', '21', '31'],
  342. showTotal: (total, range) => {
  343. var current = this.ipagination.current
  344. if(this.showListTotal){
  345. return (range[0] - current + 1) + "-" + (range[1] - current) + " 共" + this.showListTotal + "条"
  346. } else {
  347. return range[0] + "-" + range[1] + " 共" + total + "条"
  348. }
  349. },
  350. showQuickJumper: true,
  351. showSizeChanger: true,
  352. total: 0,
  353. // 显示时减去筛选行
  354. buildOptionText: (size) => {
  355. return new Number(size.value) - 1 + '条/页'
  356. }
  357. },
  358. // 用来前端显示出去筛选行的total
  359. showListTotal: 0,
  360. description: '项目成本管理页面',
  361. // 一键折叠/展开
  362. expandedRowKeys: [],
  363. // 是否全部展开
  364. isExpanded: false,
  365. // 获取比对级
  366. chooseRowType: undefined,
  367. // 比对状态
  368. chooseStatus: true,
  369. // 获取到的比对数据
  370. duibiList: {},
  371. // 获取到的材料费比对数据
  372. duibiclList: [],
  373. // 比对弹框是否显示
  374. duiBi: false,
  375. // 表头:当前显示的列,初始为全部
  376. columns: [],
  377. //列设置:多选弹窗显示的
  378. settingColumns:[],
  379. //列定义:所有列
  380. defColumns: [
  381. // {
  382. // title: '#',
  383. // dataIndex: '',
  384. // key:'rowIndex',
  385. // width:60,
  386. // align:"center",
  387. // customRender:function (t,r,index) {
  388. // return parseInt(index)+1;
  389. // }
  390. // },
  391. {
  392. title:'任务号',
  393. fixed:"left",
  394. dataIndex: 'taskno',
  395. width: 120,
  396. customHeaderCell:() => ({
  397. style: {
  398. textAlign: 'center', // 表头居中
  399. }
  400. })
  401. },
  402. {
  403. title:'任务名称',
  404. align:"center",
  405. fixed:"left",
  406. width: 120,
  407. dataIndex: 'taskname',
  408. ellipsis: true,
  409. },
  410. {
  411. title:'型号',
  412. align:"center",
  413. width: 120,
  414. dataIndex: 'xhname',
  415. },
  416. {
  417. title:'计划完成时间',
  418. align:"center",
  419. width: 120,
  420. dataIndex: 'jhwcsj',
  421. customRender:function (text) {
  422. return !text?"":(text.length>10?text.substr(0,10):text)
  423. }
  424. },
  425. {
  426. title:'阶段',
  427. align:"center",
  428. width: 80,
  429. dataIndex: 'yzjdname'
  430. },
  431. {
  432. title:'项目进度',
  433. align:"center",
  434. width: 80,
  435. dataIndex: 'processpercent',
  436. customRender: (text, record) => {
  437. return record.id === 'amount'?null:parseInt(text)+ '%'
  438. },
  439. },
  440. {
  441. title:'成本进度',
  442. align:"center",
  443. width: 80,
  444. dataIndex: 'costPercent',
  445. customRender: (text, record) => {
  446. return record.id === 'amount'?null:(Number(text) * 100).toFixed(0) + '%'
  447. },
  448. },
  449. {
  450. title:'已收款',
  451. align:"center",
  452. width: 80,
  453. dataIndex: 'taskmoney',
  454. // scopedSlots: {
  455. // customRender: 'taskmoney',
  456. // },
  457. customRender: (text) => {
  458. return (Number(text)/10000).toFixed(2)
  459. },
  460. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'taskmoney', '已收款')}
  461. },
  462. {
  463. title:'合同额',
  464. align:"center",
  465. width: 80,
  466. dataIndex: 'contractfpe',
  467. // scopedSlots: {
  468. // customRender: 'contractfpe',
  469. // },
  470. // customCell: this.getClickColumn,
  471. customRender: (text) => {
  472. return (Number(text)/10000).toFixed(2)
  473. },
  474. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'contractfpe', '合同额')}
  475. },
  476. {
  477. title:'预估价',
  478. align:"center",
  479. width: 80,
  480. dataIndex: 'estimationcoat',
  481. customRender: (text, record) => {
  482. return record.contractfpe ? '-' : Number(text).toFixed(2)
  483. },
  484. },
  485. {
  486. title:'项目预算',
  487. align:"center",
  488. width: 80,
  489. dataIndex: 'xmys',
  490. customRender: (text) => {
  491. return (Number(text)/10000).toFixed(2)
  492. },
  493. },
  494. {
  495. title:'总成本',
  496. align:"center",
  497. width: 80,
  498. dataIndex: 'zcb',
  499. customRender: (text) => {
  500. return (Number(text)/10000).toFixed(2)
  501. },
  502. customCell: (record, index)=>{ return this.customCellZcbDetail(record, index, 'zcb', '总成本')}
  503. },
  504. {
  505. title:'利润额',
  506. align:"center",
  507. width: 80,
  508. dataIndex: 'lre',
  509. customRender: (text) => {
  510. return (Number(text)/10000).toFixed(2)
  511. },
  512. },
  513. {
  514. title:'利润率',
  515. align:"center",
  516. width: 80,
  517. dataIndex: 'lrl',
  518. customRender: (text) => {
  519. return (Number(text) * 100).toFixed(1) + '%'
  520. },
  521. },
  522. {
  523. title:'研制数量',
  524. align:"center",
  525. width: 80,
  526. dataIndex: 'yzsl'
  527. },
  528. {
  529. title:'单台利润',
  530. align:"center",
  531. width: 80,
  532. dataIndex: 'oneProfit',
  533. customRender: (text, record) => {
  534. return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
  535. },
  536. },
  537. {
  538. title:'单台收入',
  539. align:"center",
  540. width: 80,
  541. dataIndex: 'oneIncome',
  542. customRender: (text, record) => {
  543. return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
  544. },
  545. },
  546. {
  547. title:'单台成本',
  548. align:"center",
  549. width: 80,
  550. dataIndex: 'oneCost',
  551. customRender: (text, record) => {
  552. return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
  553. },
  554. },
  555. {
  556. title:'材料预算',
  557. align:"center",
  558. width: 80,
  559. dataIndex: 'clys',
  560. customRender: (text) => {
  561. return Number(text).toFixed(2)
  562. },
  563. },
  564. {
  565. title:'材料费',
  566. align:"center",
  567. width: 80,
  568. dataIndex: 'clf',
  569. // scopedSlots: {
  570. // customRender: 'clf',
  571. // },
  572. // customRender: (text) => {
  573. // return (Number(text)/10000).toFixed(2)
  574. // },
  575. customRender:function (text,record,index) {
  576. var wanyuan = (Number(text)/10000).toFixed(2)
  577. let classTag = {
  578. class: `${ record.id !== 'amount' && record.clys != 0 && wanyuan > record.clys ? 'exceed-budget-status':''}`
  579. }
  580. return {
  581. children: (
  582. <span {...classTag}>{wanyuan}</span>
  583. )
  584. };
  585. },
  586. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'clf', '材料费')}
  587. },
  588. {
  589. title:'专用预算',
  590. align:"center",
  591. width: 80,
  592. dataIndex: 'zyys',
  593. customRender: (text) => {
  594. return Number(text).toFixed(2)
  595. },
  596. },
  597. {
  598. title:'专用费',
  599. align:"center",
  600. width: 80,
  601. dataIndex: 'zyf',
  602. // scopedSlots: {
  603. // customRender: 'zyf',
  604. // },
  605. customRender:function (text,record,index) {
  606. var wanyuan = (Number(text)/10000).toFixed(2)
  607. let classTag = {
  608. class: `${ record.id !== 'amount' && record.zyys != 0 && wanyuan > record.zyys ? 'exceed-budget-status':''}`
  609. }
  610. return {
  611. children: (
  612. <span {...classTag}>{wanyuan}</span>
  613. )
  614. };
  615. },
  616. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'zyf', '专用费')}
  617. },
  618. {
  619. title:'事务预算',
  620. align:"center",
  621. width: 80,
  622. dataIndex: 'swys',
  623. customRender: (text) => {
  624. return Number(text).toFixed(2)
  625. },
  626. },
  627. {
  628. title:'事务费',
  629. align:"center",
  630. width: 80,
  631. dataIndex: 'swf',
  632. // scopedSlots: {
  633. // customRender: 'swf',
  634. // },
  635. customRender:function (text,record,index) {
  636. var wanyuan = (Number(text)/10000).toFixed(2)
  637. let classTag = {
  638. class: `${ record.id !== 'amount' && record.swys != 0 && wanyuan > record.swys ? 'exceed-budget-status':''}`
  639. }
  640. return {
  641. children: (
  642. <span {...classTag}>{wanyuan}</span>
  643. )
  644. };
  645. },
  646. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'swf', '事务费')}
  647. },
  648. {
  649. title:'外协预算',
  650. align:"center",
  651. width: 80,
  652. dataIndex: 'wxys',
  653. customRender: (text) => {
  654. return Number(text).toFixed(2)
  655. },
  656. },
  657. {
  658. title:'外协费',
  659. align:"center",
  660. width: 80,
  661. dataIndex: 'wxf',
  662. // scopedSlots: {
  663. // customRender: 'wxf',
  664. // },
  665. customRender:function (text,record,index) {
  666. var wanyuan = (Number(text)/10000).toFixed(2)
  667. let classTag = {
  668. class: `${ record.id !== 'amount' && record.wxys != 0 && wanyuan > record.wxys ? 'exceed-budget-status':''}`
  669. }
  670. return {
  671. children: (
  672. <span {...classTag}>{wanyuan}</span>
  673. )
  674. };
  675. },
  676. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'wxf', '外协费')}
  677. },
  678. {
  679. title:'间接预算',
  680. align:"center",
  681. width: 80,
  682. dataIndex: 'jjys',
  683. customRender: (text) => {
  684. return Number(text).toFixed(2)
  685. },
  686. },
  687. {
  688. title:'间接汇总',
  689. align:"center",
  690. width: 80,
  691. dataIndex: 'jjfhz',
  692. // customRender: (text) => {
  693. // return Number(text).toFixed(2)
  694. // },
  695. customRender:function (text,record,index) {
  696. var wanyuan = (Number(text)/10000).toFixed(2)
  697. let classTag = {
  698. class: `${ record.id !== 'amount' && record.jjys != 0 && wanyuan > record.jjys ? 'exceed-budget-status':''}`
  699. }
  700. return {
  701. children: (
  702. <span {...classTag}>{wanyuan}</span>
  703. )
  704. };
  705. },
  706. },
  707. {
  708. title:'燃动费',
  709. align:"center",
  710. width: 80,
  711. dataIndex: 'rldlf',
  712. customRender: (text) => {
  713. return (Number(text)/10000).toFixed(2)
  714. },
  715. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'rldlf', '燃动费')}
  716. },
  717. {
  718. title:'固资费',
  719. align:"center",
  720. width: 80,
  721. dataIndex: 'gdzczj',
  722. customRender: (text) => {
  723. return (Number(text)/10000).toFixed(2)
  724. },
  725. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'gdzczj', '固资费')}
  726. },
  727. {
  728. title:'人工费',
  729. align:"center",
  730. width: 80,
  731. dataIndex: 'gzjlwf',
  732. customRender: (text) => {
  733. return (Number(text)/10000).toFixed(2)
  734. },
  735. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'gzjlwf', '人工费')}
  736. },
  737. {
  738. title:'管理费',
  739. align:"center",
  740. width: 80,
  741. dataIndex: 'glf',
  742. customRender: (text) => {
  743. return (Number(text)/10000).toFixed(2)
  744. },
  745. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'glf', '管理费')}
  746. },
  747. {
  748. title:'筛选费',
  749. align:"center",
  750. width: 80,
  751. dataIndex: 'sxf',
  752. customRender: (text) => {
  753. return (Number(text)/10000).toFixed(2)
  754. },
  755. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'sxf', '筛选费')}
  756. },
  757. {
  758. title:'装机成本',
  759. align:"center",
  760. width: 80,
  761. dataIndex: 'zjcb',
  762. // scopedSlots: {
  763. // customRender: 'zjcb',
  764. // },
  765. customRender: (text) => {
  766. return (Number(text)/10000).toFixed(2)
  767. },
  768. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'zjcb', '装机成本')}
  769. },
  770. {
  771. title:'内部试验',
  772. align:"center",
  773. width: 80,
  774. dataIndex: 'lbsy',
  775. ellipsis: true,
  776. },
  777. {
  778. title:'工时(h)',
  779. align:"center",
  780. width: 80,
  781. dataIndex: 'workhour',
  782. // scopedSlots: {
  783. // customRender: 'workhour',
  784. // },
  785. customCell: (record, index)=>{ return this.customCellDetail(record, index, 'workhour', '工时')}
  786. },
  787. {
  788. title:'责任部门',
  789. align:"center",
  790. width: 120,
  791. dataIndex: 'zrbm',
  792. ellipsis: true,
  793. },
  794. // {
  795. // title:'下达部门id',
  796. // align:"center",
  797. // dataIndex: 'jycsid'
  798. // },
  799. {
  800. title:'下达部门',
  801. align:"center",
  802. width: 120,
  803. dataIndex: 'jycs',
  804. ellipsis: true,
  805. },
  806. // {
  807. // title:'1:横向 2:纵向',
  808. // align:"center",
  809. // dataIndex: 'hxzxid'
  810. // },
  811. {
  812. title:'横向纵向',
  813. align:"center",
  814. width: 80,
  815. dataIndex: 'hxzxname'
  816. },
  817. {
  818. title:'任务类型',
  819. align:"center",
  820. width: 80,
  821. dataIndex: 'tasktype'
  822. },
  823. {
  824. title:'审计审价',
  825. align:"center",
  826. width: 80,
  827. dataIndex: 'auditprice'
  828. },
  829. {
  830. title:'任务状态',
  831. align:"center",
  832. width: 80,
  833. dataIndex: 'iflag'
  834. },
  835. {
  836. title:'提出单位简称',
  837. align:"center",
  838. width: 120,
  839. dataIndex: 'brief'
  840. },
  841. {
  842. title:'父级任务',
  843. align:"center",
  844. width: 80,
  845. dataIndex: 'reftaskno'
  846. },
  847. {
  848. title:'批产任务号',
  849. align:"center",
  850. width: 80,
  851. dataIndex: 'pccode'
  852. },
  853. {
  854. title:'备产任务号',
  855. align:"center",
  856. width: 80,
  857. dataIndex: 'bccode'
  858. },
  859. {
  860. title:'备料任务号',
  861. align:"center",
  862. width: 80,
  863. dataIndex: 'blcode'
  864. },
  865. {
  866. title:'业务员',
  867. align:"center",
  868. width: 80,
  869. dataIndex: 'businessManName',
  870. ellipsis: true,
  871. },
  872. {
  873. title:'主管设计师',
  874. align:"center",
  875. width: 100,
  876. dataIndex: 'ywfzrname',
  877. ellipsis: true,
  878. },
  879. {
  880. title:'科研任务负责人',
  881. align:"center",
  882. width: 120,
  883. dataIndex: 'xhzzrname',
  884. ellipsis: true,
  885. },
  886. {
  887. title:'设计工时',
  888. align:"center",
  889. width: 80,
  890. dataIndex: 'sjgs'
  891. },
  892. {
  893. title:'生产工时',
  894. align:"center",
  895. width: 80,
  896. dataIndex: 'scgs'
  897. },
  898. // {
  899. // title:'级别',
  900. // align:"center",
  901. // dataIndex: 'ji',
  902. // customCell: this.getClickColumn,
  903. // },
  904. {
  905. title: '操作',
  906. dataIndex: 'action',
  907. align:"center",
  908. fixed:"right",
  909. width: 150,
  910. scopedSlots: {
  911. // filterDropdown: 'filterDropdown',
  912. // filterIcon: 'filterIcon',
  913. customRender: 'action',
  914. }
  915. }
  916. ],
  917. url: {
  918. list: "/projectCostHuiji/projectCostHuiji/list",
  919. // delete: "/projectCost/projectCost/delete",
  920. // deleteBatch: "/projectCost/projectCost/deleteBatch",
  921. exportXlsUrl: "/projectCostHuiji/projectCostHuiji/exportXlsProjectCost",
  922. importExcelUrl: "projectCost/projectCost/importExcel",
  923. },
  924. dictOptions:{},
  925. superFieldList:[],
  926. // 拖拽
  927. handlerFirstTime: null,
  928. isClick: false,
  929. mouseFlag: false,
  930. mouseOffset: null,
  931. // 比对
  932. duibiIds: '',
  933. duibiTasknos: '',
  934. }
  935. },
  936. created() {
  937. this.loadData()
  938. this.initColumns();
  939. this.getSuperFieldList();
  940. },
  941. mounted() {
  942. // console.log(window.innerHeight, this.$refs.table)
  943. this.$nextTick(() => {
  944. this.scrollHeight = window.innerHeight - 60 - 25 - 55 - 25
  945. // this.scrollHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 60 - 52 - 50 - 56 - 60 - 34
  946. })
  947. },
  948. computed: {
  949. importExcelUrl: function(){
  950. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  951. },
  952. },
  953. methods: {
  954. // 按下鼠标记录鼠标位置
  955. mouseDownHandler(e) {
  956. this.mouseOffset = e.clientX;
  957. this.handlerFirstTime = new Date().getTime()
  958. this.mouseFlag = true;
  959. // console.log(this.mouseOffset)
  960. },
  961. mouseUpHandler(e) {
  962. var lastTime = new Date().getTime();
  963. this.mouseFlag = false;
  964. if( (lastTime - this.handlerFirstTime) < 100){
  965. this.isClick = true
  966. } else {
  967. this.isClick = false
  968. }
  969. },
  970. mouseMoveHandler(e) {
  971. // 这里面需要注意,通过ref需要那个那个包含table元素的父元素
  972. let v=document.getElementsByClassName("ant-table-body")[0]
  973. v.style.cursor = 'move'
  974. v.style['user-select'] = 'none'
  975. if (this.mouseFlag) {
  976. // 设置水平方向的元素的位置
  977. v.scrollLeft -= (- this.mouseOffset + (this.mouseOffset = e.clientX));
  978. }
  979. },
  980. loadData(arg) {
  981. if(!this.url.list){
  982. this.$message.error("请设置url.list属性!")
  983. return
  984. }
  985. //加载数据 若传入参数1则加载第一页的内容
  986. if (arg === 1) {
  987. this.ipagination.current = 1;
  988. }
  989. var params = this.getQueryParams();//查询条件
  990. // 查询时减去筛选行
  991. params.pageSize = (Number(params.pageSize) - 1).toString()
  992. this.loading = true;
  993. getAction(this.url.list, params).then((res) => {
  994. if (res.success) {
  995. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  996. this.dataSource = res.result.pageList.records||res.result.pageList;
  997. var amount = res.result.projectCostHuiji
  998. amount.taskno = '筛选合计:'
  999. amount.id = 'amount'
  1000. // amount.id = 'amount'+res.result.pageList.current
  1001. this.dataSource.unshift(amount)
  1002. if(res.result.pageList.total)
  1003. {
  1004. // 解决页数显示不对的问题:因为a-table当前默认是加上筛选行的,合计时几页就加上几
  1005. // 例如:当前total后端返回32,一页10个应该是4页,但是a-table调用的是一页11个,所以32/11 会显示3页
  1006. this.ipagination.total = res.result.pageList.total + res.result.pageList.pages;
  1007. // 设置显示的total数
  1008. this.showListTotal = res.result.pageList.total
  1009. }else{
  1010. this.ipagination.total = 0;
  1011. }
  1012. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  1013. }else{
  1014. this.$message.warning(res.message)
  1015. }
  1016. }).finally(() => {
  1017. this.loading = false
  1018. })
  1019. },
  1020. initDictConfig(){
  1021. },
  1022. initColumns(){
  1023. //权限过滤(列权限控制时打开,修改第二个参数为授权码前缀)
  1024. // this.defColumns = colAuthFilter(this.defColumns,'testdemo:');
  1025. columnsSelect().then(res => {
  1026. let colSettings = res
  1027. if(colSettings==null||colSettings==undefined || colSettings.length === 0){
  1028. let allSettingColumns = [];
  1029. this.defColumns.forEach(function (item,i,array ) {
  1030. allSettingColumns.push(item.dataIndex);
  1031. })
  1032. this.settingColumns = allSettingColumns;
  1033. this.columns = this.defColumns;
  1034. }else{
  1035. this.settingColumns = colSettings;
  1036. const cols = this.defColumns.filter(item => {
  1037. if(item.key =='rowIndex'|| item.dataIndex=='action'){
  1038. return true;
  1039. }
  1040. if (colSettings.includes(item.dataIndex)) {
  1041. return true;
  1042. }
  1043. return false;
  1044. })
  1045. this.columns = cols;
  1046. }
  1047. })
  1048. // 储存浏览器方式
  1049. // var key = this.$route.name+":colsettings";
  1050. // let colSettings= Vue.ls.get(key);
  1051. },
  1052. // 行颜色设置
  1053. setRowClassName(record, index){
  1054. if(record.lrl < 0){
  1055. // 亏损标红
  1056. return 'table-kuisun-color'
  1057. }
  1058. if(record.status === '1'){
  1059. // 汇集计算之后的数据标浅灰
  1060. return 'table-zupi-color'
  1061. }
  1062. if(record.hjstatus === '4'){
  1063. // 加入产品价格库的
  1064. return 'table-chanpin-model-color'
  1065. }
  1066. },
  1067. //列设置更改事件
  1068. onColSettingsChange (checkedValues) {
  1069. // 获取浏览器方式
  1070. // var key = this.$route.name+":colsettings";
  1071. // Vue.ls.set(key, checkedValues, 7 * 24 * 60 * 60 * 1000)
  1072. this.settingColumns = checkedValues;
  1073. const cols = this.defColumns.filter(item => {
  1074. if(item.key =='rowIndex'|| item.dataIndex=='action'){
  1075. return true
  1076. }
  1077. if (this.settingColumns.includes(item.dataIndex)) {
  1078. return true
  1079. }
  1080. return false
  1081. })
  1082. this.columns = cols;
  1083. columnsEdit({checkedValues: checkedValues})
  1084. },
  1085. customCellDetail(record, index, columnValue, columnTitle){
  1086. // if(record.children || record.id === 'amount'){
  1087. // return false
  1088. // }
  1089. // 改成汇集层也需要弹窗且汇集层装机成本和工时不弹窗
  1090. if(record.id === 'amount' || (record.ji === 1 && columnValue === 'zjcb') || (record.ji === 1 && columnValue === 'workhour')){
  1091. return false
  1092. }
  1093. return {
  1094. style: {
  1095. // 'color': "#1890ff",
  1096. 'color': "#1890ff !important",
  1097. 'cursor': "pointer",
  1098. },
  1099. on: {
  1100. // 点击事件
  1101. click: (event) => {
  1102. },
  1103. dblclick: (event) => {
  1104. // console.log(record, index, columnValue, columnTitle)
  1105. // 没有值不弹窗--也弹窗
  1106. // if(!event.target.textContent){
  1107. // return
  1108. // }
  1109. if(record.ji === 1){
  1110. // 汇集层传所有子级任务号
  1111. var tasknos = record.children.map(item=>item.taskno)
  1112. this.$refs.proCostDetail.taskno = tasknos.join(',')
  1113. // this.$refs.proCostDetail.taskno = tasknos.toString()
  1114. }
  1115. if(record.ji === 2){
  1116. this.$refs.proCostDetail.taskno = record.taskno
  1117. }
  1118. this.$refs.proCostDetail.cengji = record.ji
  1119. if(record.status === '1' && columnValue === 'clf'){
  1120. // 批产参数
  1121. this.$refs.proCostDetail.pichanInfo = {
  1122. pccode: record.pccode,
  1123. proportion: record.proportion,
  1124. columnValue: columnValue,
  1125. }
  1126. // console.log(columnValue)
  1127. this.$refs.proCostDetail.columnValue = 'pichanTask'
  1128. this.$refs.proCostDetail.title = columnTitle + '批产明细'
  1129. } else {
  1130. this.$refs.proCostDetail.columnValue = columnValue
  1131. this.$refs.proCostDetail.title = columnTitle + '明细'
  1132. }
  1133. this.$refs.proCostDetail.show()
  1134. },
  1135. contextmenu: (event) => {},
  1136. mouseenter: (event) => {}, // 鼠标移入行
  1137. mouseleave: (event) => {}
  1138. },
  1139. };
  1140. },
  1141. // 因为新需要tab标签所以单独写一个总成本的详情,不用原来的
  1142. customCellZcbDetail(record, index, columnValue, columnTitle){
  1143. // 子级总成本不设置弹窗
  1144. if(record.id === 'amount' || (record.ji === 2 && columnValue === 'zcb')){
  1145. return false
  1146. }
  1147. return {
  1148. style: {
  1149. 'color': "#1890ff !important",
  1150. 'cursor': "pointer",
  1151. },
  1152. on: {
  1153. // 点击事件
  1154. click: (event) => {
  1155. },
  1156. // 双击事件
  1157. dblclick: (event) => {
  1158. // console.log(record, index, columnValue, columnTitle)
  1159. var tasknos = record.children.map(item=>item.taskno)
  1160. this.$refs.proCostZcbDetail.taskno = tasknos.join(',')
  1161. this.$refs.proCostZcbDetail.title = columnTitle + '明细'
  1162. this.$refs.proCostZcbDetail.show()
  1163. }
  1164. }
  1165. }
  1166. },
  1167. detailClick(text, record, columnValue, columnTitle){
  1168. if(!this.isClick){
  1169. return
  1170. }
  1171. // console.log(text, record, columnValue, columnTitle)
  1172. // 去掉没有值不弹窗判断 !text ||
  1173. if(record.children || record.id === 'amount'){
  1174. return
  1175. }
  1176. this.$refs.proCostDetail.taskno = record.taskno
  1177. if(record.status === '1' && columnValue === 'clf'){
  1178. // 批产参数
  1179. this.$refs.proCostDetail.pichanInfo = {
  1180. pccode: record.pccode,
  1181. proportion: record.proportion,
  1182. columnValue: columnValue,
  1183. }
  1184. this.$refs.proCostDetail.columnValue = 'pichanTask'
  1185. this.$refs.proCostDetail.title = columnTitle + '批产明细'
  1186. } else {
  1187. this.$refs.proCostDetail.columnValue = columnValue
  1188. this.$refs.proCostDetail.title = columnTitle + '明细'
  1189. }
  1190. this.$refs.proCostDetail.show()
  1191. },
  1192. getClickColumn(record, index){
  1193. if(record.children || record.id === 'amount'){
  1194. return false
  1195. }
  1196. return {
  1197. style: {
  1198. 'color': '#1890ff',
  1199. 'cursor': 'pointer',
  1200. },
  1201. on: {
  1202. click: (event)=> {
  1203. // 没有值不弹窗
  1204. if(!event.target.textContent){
  1205. return
  1206. }
  1207. // console.log(record, index, event, event.target.cellIndex)
  1208. // console.log(this.columns[event.target.cellIndex - 1])
  1209. var clickColumn = this.columns[event.target.cellIndex - 1].dataIndex
  1210. var title = this.columns[event.target.cellIndex - 1].title
  1211. this.$refs.proCostDetail.taskno = record.taskno
  1212. if(record.status === '1'){
  1213. // 批产参数
  1214. this.$refs.proCostDetail.pichanInfo = {
  1215. pccode: record.pccode,
  1216. proportion: record.proportion,
  1217. columnValue: clickColumn,
  1218. }
  1219. this.$refs.proCostDetail.columnValue = 'pichanTask'
  1220. this.$refs.proCostDetail.title = title + '批产明细'
  1221. } else {
  1222. this.$refs.proCostDetail.columnValue = clickColumn
  1223. this.$refs.proCostDetail.title = title + '明细'
  1224. }
  1225. // console.log(this.$refs.proCostDetail.columnValue)
  1226. this.$refs.proCostDetail.show()
  1227. },
  1228. }
  1229. }
  1230. },
  1231. // 费用导入后执行一次计算程序
  1232. handleComputed(){
  1233. this.loading = true
  1234. visibleClientStart().then(response => {
  1235. this.loadData()
  1236. })
  1237. },
  1238. // 比对
  1239. batchDuiBi(){
  1240. // console.log(this.selectedRowKeys,this.selectionRows)
  1241. // console.log(JSON.stringify(this.selectedRowKeys))
  1242. var selectTasknos = this.selectionRows.map( res => {
  1243. var value = res.status === '1' ? res.taskno+'_-_pc' : res.taskno
  1244. return value
  1245. })
  1246. this.duibiTasknos = selectTasknos.toString()
  1247. this.duibiIds = this.selectedRowKeys.toString()
  1248. this.duiBi = true
  1249. // if (this.chooseRowType == 1) {
  1250. // var a = this.selectedRowKeys
  1251. // var ids = a.toString()
  1252. // getHjList({ids: ids}).then((res) => {
  1253. // this.duibiList = res
  1254. // this.duibiclList = []
  1255. // })
  1256. // var selectTasknos = this.selectionRows.map( res => {
  1257. // return res.taskno
  1258. // })
  1259. // var tasknos = selectTasknos.toString()
  1260. // getDbClList({tasknos: tasknos}).then((res) => {
  1261. // this.duibiclList = res.result.resultVOList
  1262. // this.duiBi = true
  1263. // })
  1264. // } else {
  1265. // var a = this.selectedRowKeys
  1266. // var ids = a.toString()
  1267. // getDbList({ids: ids}).then((res) => {
  1268. // this.duibiList = res
  1269. // })
  1270. // var selectTasknos = this.selectionRows.map( res => {
  1271. // return res.taskno
  1272. // })
  1273. // var tasknos = selectTasknos.toString()
  1274. // getDbClList({tasknos: tasknos}).then((res) => {
  1275. // this.duibiclList = res.result.resultVOList
  1276. // this.duiBi = true
  1277. // })
  1278. // }
  1279. // var a = this.selectedRowKeys
  1280. // var ids = a.toString()
  1281. // getDbList({ids: ids}).then((res) => {
  1282. // this.duibiList = res
  1283. // })
  1284. // var selectTasknos = this.selectionRows.map( res => {
  1285. // return res.taskno
  1286. // })
  1287. // var tasknos = selectTasknos.toString()
  1288. // getDbClList({tasknos: tasknos}).then((res) => {
  1289. // this.duibiclList = res
  1290. // this.duiBi = true
  1291. // })
  1292. },
  1293. // 关闭比对弹框
  1294. handleGb(){
  1295. this.duiBi = false
  1296. this.duibiList = {}
  1297. this.duibiclList = []
  1298. },
  1299. // 一键折叠展开
  1300. handleExpand(){
  1301. // console.log(this.isExpanded)
  1302. if(this.isExpanded){
  1303. // 当前为展开,全部折叠
  1304. this.expandedRowKeys = []
  1305. } else {
  1306. // 当前为折叠,全部展开
  1307. this.expandedRowKeys = this.dataSource.map(res => res.id)
  1308. }
  1309. this.isExpanded = !this.isExpanded
  1310. },
  1311. onExpand (expanded, record) {
  1312. if (expanded) {
  1313. // 设置展开窗Key,代表展开操作
  1314. this.expandedRowKeys.push(record.id)
  1315. } else {
  1316. // 代表折叠操作
  1317. if (this.expandedRowKeys.length) {
  1318. this.expandedRowKeys = this.expandedRowKeys.filter(v => {
  1319. return v !== record.id
  1320. })
  1321. }
  1322. }
  1323. },
  1324. // 虚实比对(堆叠图)
  1325. handleXushi(record){
  1326. this.$refs.xushi.open(record)
  1327. },
  1328. // 加入产品模型
  1329. handleAddProjectModel(record){
  1330. var arr = []
  1331. arr.push(record)
  1332. insertIntoProject(arr).then(response => {
  1333. this.loadData()
  1334. })
  1335. },
  1336. // 比对禁选判断
  1337. onSelectChange(selectedRowKeys, selectionRows) {
  1338. // this.selectedRowKeys = selectedRowKeys;
  1339. // this.selectionRows = selectionRows;
  1340. // 解决分页后selectionRows只获取本页面勾选的问题
  1341. for (let val of selectionRows) {
  1342. if (!this.selectionRows.find((item) => item.id === val.id)) {
  1343. this.selectionRows.push(val);
  1344. }
  1345. }
  1346. this.selectedRowKeys = selectedRowKeys;
  1347. this.selectionRows = this.selectionRows.filter((item) =>
  1348. this.selectedRowKeys.includes(item.id)
  1349. );
  1350. },
  1351. onSelect(record, selected, selectedRows, nativeEvent){
  1352. // console.log(record, selected, selectedRows, nativeEvent)
  1353. // console.log(this.selectionRows)
  1354. if(selected) {
  1355. if (this.selectionRows.length == 1) {
  1356. this.chooseRowType = record.ji
  1357. this.chooseStatus = true
  1358. } else {
  1359. // console.log(this.chooseRowType,record.ji)
  1360. if (this.chooseRowType != record.ji) {
  1361. this.chooseRowType = this.chooseRowType
  1362. this.chooseStatus = true
  1363. this.$message.error("请选择同级项进行比对");
  1364. } else{
  1365. // this.chooseStatus = false
  1366. for (let i = 0; i < this.selectionRows.length; i++) {
  1367. const element = this.selectionRows[i].ji;
  1368. if (this.chooseRowType != element) {
  1369. this.chooseStatus = true
  1370. } else {
  1371. this.chooseStatus = false
  1372. }
  1373. }
  1374. }
  1375. }
  1376. } else{
  1377. if (this.selectionRows.length == 1) {
  1378. this.chooseRowType = this.selectionRows[0].ji
  1379. this.chooseStatus = true
  1380. } else {
  1381. for (let i = 0; i < this.selectionRows.length; i++) {
  1382. const element = this.selectionRows[i].ji;
  1383. if (this.chooseRowType != element) {
  1384. this.chooseStatus = true
  1385. this.$message.error("请选择同级项进行比对");
  1386. } else {
  1387. this.chooseStatus = false
  1388. }
  1389. }
  1390. // 第一版
  1391. // if (this.chooseRowType != record.ji) {
  1392. // this.chooseRowType = this.chooseRowType
  1393. // this.chooseStatus = true
  1394. // this.$message.error("请选择同级项进行比对");
  1395. // }else{
  1396. // // this.chooseStatus = false
  1397. // for (let i = 0; i < selectedRows.length; i++) {
  1398. // const element = selectedRows[i].ji;
  1399. // if (this.chooseRowType != element) {
  1400. // this.chooseStatus = true
  1401. // } else {
  1402. // this.chooseStatus = false
  1403. // }
  1404. // }
  1405. // }
  1406. }
  1407. }
  1408. // if (record.ji == '2') {
  1409. // // 选中二级,一级禁选
  1410. // this.chooseRowType == 'chengben'
  1411. // } else {
  1412. // // 选中一级,二级禁选
  1413. // this.chooseRowType == 'huiji'
  1414. // }
  1415. },
  1416. export(value, fileName){
  1417. // if(!fileName || typeof fileName != "string"){
  1418. // fileName = "导出文件"
  1419. // }
  1420. // let param = this.getQueryParams();
  1421. // if(this.selectedRowKeys && this.selectedRowKeys.length>0){
  1422. // param['selections'] = this.selectedRowKeys.join(",")
  1423. // }
  1424. var param = {isFolding: value}
  1425. downFile(this.url.exportXlsUrl,param).then((data)=>{
  1426. // console.log(data)
  1427. if (!data) {
  1428. this.$message.warning("文件下载失败")
  1429. return
  1430. }
  1431. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  1432. window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
  1433. }else{
  1434. let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
  1435. let link = document.createElement('a')
  1436. link.style.display = 'none'
  1437. link.href = url
  1438. link.setAttribute('download', fileName+'.xls')
  1439. document.body.appendChild(link)
  1440. link.click()
  1441. document.body.removeChild(link); //下载完成移除元素
  1442. window.URL.revokeObjectURL(url); //释放掉blob对象
  1443. }
  1444. })
  1445. },
  1446. // 导出
  1447. handleExportXls(){
  1448. var isFolding
  1449. var fileName = "项目成本"
  1450. var _this = this
  1451. const modal = this.$confirm({
  1452. title: '请选择导出数据类型',
  1453. content: '*全部数据=汇集层+子级',
  1454. okText: '全部数据',
  1455. // okType: 'danger',
  1456. cancelText: '汇集数据',
  1457. closable: true, // 显示右上角关闭按钮
  1458. onOk() {
  1459. isFolding = 1
  1460. fileName = '项目成本-全部数据'
  1461. _this.export(isFolding, fileName)
  1462. },
  1463. onCancel(e) {
  1464. // console.log(e)
  1465. // 如果是右上角关闭触发,则不导出,只关闭
  1466. if(e.triggerCancel) return
  1467. isFolding = 0
  1468. fileName = '项目成本-汇集数据'
  1469. _this.export(isFolding, fileName)
  1470. modal.destroy();
  1471. },
  1472. });
  1473. },
  1474. getSuperFieldList(){
  1475. let fieldList=[];
  1476. fieldList.push({type:'string',value:'taskno',text:'任务号',dictCode:''})
  1477. fieldList.push({type:'string',value:'taskname',text:'任务名称',dictCode:''})
  1478. fieldList.push({type:'string',value:'xhname',text:'型号',dictCode:''})
  1479. // fieldList.push({type:'date',value:'jhwcsj',text:'计划完成时间'})
  1480. fieldList.push({type:'string',value:'yzjdname',text:'阶段',dictCode:''})
  1481. fieldList.push({type:'string',value:'processpercent',text:'项目进度',dictCode:''})
  1482. fieldList.push({type:'string',value:'costPercent',text:'成本进度',dictCode:''})
  1483. // fieldList.push({type:'int',value:'yzsl',text:'研制数量',dictCode:''})
  1484. // fieldList.push({type:'BigDecimal',value:'oneIncome',text:'单台收入',dictCode:''})
  1485. // fieldList.push({type:'BigDecimal',value:'oneCost',text:'单台成本',dictCode:''})
  1486. // fieldList.push({type:'BigDecimal',value:'oneProfit',text:'单台利润',dictCode:''})
  1487. // fieldList.push({type:'BigDecimal',value:'lre',text:'利润额',dictCode:''})
  1488. // fieldList.push({type:'BigDecimal',value:'lrl',text:'利润率',dictCode:''})
  1489. // fieldList.push({type:'BigDecimal',value:'estimationcoat',text:'预估价',dictCode:''})
  1490. // fieldList.push({type:'BigDecimal',value:'contractfpe',text:'合同额',dictCode:''})
  1491. // fieldList.push({type:'BigDecimal',value:'taskmoney',text:'已收款',dictCode:''})
  1492. // fieldList.push({type:'BigDecimal',value:'zcb',text:'总成本',dictCode:''})
  1493. // fieldList.push({type:'BigDecimal',value:'clf',text:'材料费',dictCode:''})
  1494. // fieldList.push({type:'BigDecimal',value:'zyf',text:'专用费',dictCode:''})
  1495. // fieldList.push({type:'BigDecimal',value:'swf',text:'事务费',dictCode:''})
  1496. // fieldList.push({type:'BigDecimal',value:'wxf',text:'外协费',dictCode:''})
  1497. // fieldList.push({type:'BigDecimal',value:'rldlf',text:'燃料动力费',dictCode:''})
  1498. // fieldList.push({type:'BigDecimal',value:'gdzczj',text:'固定资产折旧',dictCode:''})
  1499. // fieldList.push({type:'BigDecimal',value:'gzjlwf',text:'工资及劳务费',dictCode:''})
  1500. // fieldList.push({type:'BigDecimal',value:'glf',text:'管理费',dictCode:''})
  1501. // fieldList.push({type:'BigDecimal',value:'zjcb',text:'装机成本',dictCode:''})
  1502. // fieldList.push({type:'BigDecimal',value:'lbsy',text:'内部试验',dictCode:''})
  1503. // fieldList.push({type:'BigDecimal',value:'workhour',text:'工时(h)',dictCode:''})
  1504. fieldList.push({type:'string',value:'zrbm',text:'责任部门',dictCode:''})
  1505. // fieldList.push({type:'int',value:'jycsid',text:'下达部门id',dictCode:''})
  1506. fieldList.push({type:'string',value:'jycs',text:'下达部门',dictCode:''})
  1507. // fieldList.push({type:'int',value:'hxzxid',text:'1:横向 2:纵向/来自科研任务',dictCode:''})
  1508. fieldList.push({type:'string',value:'hxzxname',text:'横向纵向',dictCode:''})
  1509. fieldList.push({type:'string',value:'tasktype',text:'任务类型',dictCode:''})
  1510. // fieldList.push({type:'string',value:'auditprice',text:'审计审价',dictCode:''})
  1511. fieldList.push({type:'string',value:'iflag',text:'任务状态',dictCode:''})
  1512. fieldList.push({type:'string',value:'brief',text:'提出单位简称',dictCode:''})
  1513. fieldList.push({type:'int',value:'reftaskno',text:'父级任务',dictCode:''})
  1514. fieldList.push({type:'int',value:'pccode',text:'批产任务号',dictCode:''})
  1515. // fieldList.push({type:'int',value:'bccode',text:'备产任务号',dictCode:''})
  1516. // fieldList.push({type:'int',value:'blcode',text:'备料任务号',dictCode:''})
  1517. fieldList.push({type:'string',value:'businessman',text:'业务员',dictCode:''})
  1518. // fieldList.push({type:'BigDecimal',value:'sjgs',text:'设计工时',dictCode:''})
  1519. // fieldList.push({type:'BigDecimal',value:'scgs',text:'生产工时',dictCode:''})
  1520. this.superFieldList = fieldList
  1521. },
  1522. }
  1523. }
  1524. </script>
  1525. <style scoped>
  1526. @import '~@assets/less/common.less';
  1527. /*表格thead*/
  1528. ::v-deep .ant-table-thead > tr > th {
  1529. font-size: 14px;
  1530. /* color: #000; */
  1531. }
  1532. /*表格tbody*/
  1533. ::v-deep .ant-table-tbody > tr > td {
  1534. font-size: 13px;
  1535. padding: 6px 4px !important;
  1536. }
  1537. </style>
  1538. <style>
  1539. /* 超出预算 */
  1540. .exceed-budget-status{
  1541. color: #ffa300 !important;
  1542. }
  1543. .table-kuisun-color{
  1544. color: red !important;
  1545. /* user-select: 'none'; */
  1546. }
  1547. .table-zupi-color{
  1548. color: #b3b2b2 !important;
  1549. /* user-select: 'none'; */
  1550. }
  1551. .table-chanpin-model-color{
  1552. color: #29d59f !important;
  1553. /* color: #438bf7 !important; */
  1554. }
  1555. </style>