costDetailDrawer.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. <template>
  2. <!-- 详情 成本分配汇总-->
  3. <div id="costDetailDrawer">
  4. <!-- 主表信息 -->
  5. <a-card :bordered="true">
  6. <div class="table-page-search-wrapper">
  7. <a-form-model layout="inline">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-model-item label="计划单号" prop="planNum">
  11. {{ detailsPlanNum.planNum }}
  12. </a-form-model-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-model-item label="产品款号" prop="poStyleNum">
  16. {{ detailsPlanNum.poStyleNum }}
  17. </a-form-model-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-model-item label="外销员" prop="exportSales">
  21. {{ detailsPlanNum.exportSales }}
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-model-item label="成衣合同号" prop="garmentContractno">
  26. {{ detailsPlanNum.garmentContractno }}
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :md="6" :sm="8">
  30. <a-form-model-item label="部门" prop="department">
  31. {{ detailsPlanNum.department }}
  32. </a-form-model-item>
  33. </a-col>
  34. <a-col :md="6" :sm="8">
  35. <a-form-model-item label="客户简称" prop="customerShortame">
  36. {{ detailsPlanNum.customerShortame }}
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :md="6" :sm="8">
  40. <a-form-model-item label="加工单位" prop="processUnit">
  41. {{ detailsPlanNum.processUnit }}
  42. </a-form-model-item>
  43. </a-col>
  44. <a-col :md="6" :sm="8">
  45. <a-form-model-item label="出运日期" prop="outdata">
  46. {{ detailsPlanNum.outdata }}
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :md="6" :sm="8">
  50. <a-form-model-item label="计划数量" prop="planQuantity">
  51. {{ detailsPlanNum.planQuantity }}
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-model-item label="美元外销总价" prop="usdTotalexportprice">
  56. {{ detailsPlanNum.usdTotalexportprice }}
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :md="6" :sm="8">
  60. <a-form-model-item label="人民币费用支出" prop="rmbExpense">
  61. {{ detailsPlanNum.rmbExpense }}
  62. <!-- <a href="javascript:void(0)" @click="mainTableExpenseCNY()">{{ detailsPlanNum.rmbExpense }}</a> -->
  63. </a-form-model-item>
  64. </a-col>
  65. <!-- <a-col :md="6" :sm="8">
  66. <a-form-model-item label="税率%" prop="taxrate">
  67. {{ detailsPlanNum.taxrate }}
  68. </a-form-model-item>
  69. </a-col> -->
  70. <a-col :md="6" :sm="8">
  71. <a-form-model-item label="实际出货数量" prop="actualShipquantity">
  72. {{ detailsPlanNum.actualShipquantity }}
  73. </a-form-model-item>
  74. </a-col>
  75. <a-col :md="6" :sm="8">
  76. <a-form-model-item label="人民币外销金额" prop="rmbExportamount">
  77. {{ detailsPlanNum.rmbExportamount }}
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :md="6" :sm="8">
  81. <a-form-model-item label="美元费用支出" prop="usdExpense">
  82. {{ detailsPlanNum.usdExpense }}
  83. <!-- <a href="javascript:void(0)" @click="mainTableExpenseUSD()">{{ detailsPlanNum.usdExpense }}</a> -->
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :md="6" :sm="8">
  87. <a-form-model-item label="加工费" prop="rmbProcesscost">
  88. {{ detailsPlanNum.rmbProcesscost }}
  89. </a-form-model-item>
  90. </a-col>
  91. <a-col :md="6" :sm="8">
  92. <a-form-model-item label="短出数" prop="shortseveral">
  93. {{ detailsPlanNum.shortseveral }}
  94. </a-form-model-item>
  95. </a-col>
  96. <a-col :md="6" :sm="8">
  97. <a-form-model-item label="短出货值" prop="shortvalue">
  98. {{ detailsPlanNum.shortvalue }}
  99. </a-form-model-item>
  100. </a-col>
  101. <!-- <a-col :md="6" :sm="8">
  102. <a-form-model-item label="短出面料成本" prop="fabricshortcost">
  103. {{ detailsPlanNum.fabricshortcost }}
  104. </a-form-model-item>
  105. </a-col> -->
  106. <a-col :md="6" :sm="8">
  107. <a-form-model-item label="事故单美金金额" prop="accidentUsdamount">
  108. {{ detailsPlanNum.accidentUsdamount }}
  109. </a-form-model-item>
  110. </a-col>
  111. <a-col :md="6" :sm="8">
  112. <a-form-model-item label="面料含税成本" prop="fabriccostIncludestax">
  113. {{ detailsPlanNum.fabriccostIncludestax }}
  114. </a-form-model-item>
  115. </a-col>
  116. <a-col :md="6" :sm="8">
  117. <a-form-model-item label="辅料含税成本" prop="excipiencostIncludestax">
  118. {{ detailsPlanNum.excipiencostIncludestax }}
  119. </a-form-model-item>
  120. </a-col>
  121. <a-col :md="6" :sm="8">
  122. <a-form-model-item label="销售订单本币总额" prop="salesordersLocaltotal">
  123. {{ detailsPlanNum.salesordersLocaltotal }}
  124. </a-form-model-item>
  125. </a-col>
  126. <a-col :md="6" :sm="8">
  127. <a-form-model-item label="事故单人民币金额" prop="accidentcnyAmount">
  128. {{ detailsPlanNum.accidentcnyAmount }}
  129. </a-form-model-item>
  130. </a-col>
  131. <a-col :md="6" :sm="8">
  132. <a-form-model-item label="面料不含税成本" prop="fabriccostNotincludestax">
  133. {{ detailsPlanNum.fabriccostNotincludestax }}
  134. </a-form-model-item>
  135. </a-col>
  136. <a-col :md="6" :sm="8">
  137. <a-form-model-item label="辅料不含税成本" prop="excipiencostNotincludestax">
  138. {{ detailsPlanNum.excipiencostNotincludestax }}
  139. </a-form-model-item>
  140. </a-col>
  141. <a-col :md="6" :sm="8">
  142. <a-form-model-item label="销售订单原币总额" prop="salesrrdersOriginaltotal">
  143. {{ detailsPlanNum.salesrrdersOriginaltotal }}
  144. </a-form-model-item>
  145. </a-col>
  146. <a-col :md="6" :sm="8">
  147. <a-form-model-item label="制单人" prop="preparedBy">
  148. {{ detailsPlanNum.preparedBy }}
  149. </a-form-model-item>
  150. </a-col>
  151. <a-col :md="6" :sm="8">
  152. <h4 style="color:red;">
  153. 标记
  154. <span>(计算结果是负值时,该标记是红色)</span>
  155. </h4>
  156. </a-col>
  157. </a-row>
  158. </a-form-model>
  159. </div>
  160. </a-card>
  161. <!-- 子表 -->
  162. <a-card :bordered="true" style="margin:10px 0">
  163. <!--tabs 组件引入 style="marginTop:60px;" -->
  164. <div>
  165. <a-tabs @change="tabsCallback" :default-active-key="activeKey">
  166. <a-tab-pane v-for="(item, index) in tabNameList" :key="index" :tab="item">
  167. <div>
  168. <h6 class="table-title">面料</h6>
  169. <a-table
  170. rowKey="(item)=>item.id"
  171. :loading="loading"
  172. :columns="fabColumns"
  173. :data-source="fabData"
  174. bordered
  175. :pagination="false"
  176. :scroll="{ x: 1500,y:300 }"
  177. >
  178. </a-table>
  179. </div>
  180. <!-- tabs 辅料 -->
  181. <div style="margin:30px 0">
  182. <h6 class="table-title">辅料</h6>
  183. <a-table
  184. rowKey="(item)=>item.id"
  185. :loading="loading"
  186. :columns="ingColumns"
  187. :data-source="ingData"
  188. bordered
  189. :pagination="false"
  190. :scroll="{ x: 1000,y:300 }"
  191. >
  192. </a-table>
  193. </div>
  194. <!-- tabs 发运明细 :scroll="{ x: 1500 }"-->
  195. <div>
  196. <h6 class="table-title">发运明细</h6>
  197. <a-table
  198. rowKey="(item)=>item.id"
  199. :loading="loading"
  200. :columns="shipColumns"
  201. :data-source="shipData"
  202. bordered
  203. :pagination="false"
  204. :scroll="{ x: 1500,y:300 }"
  205. >
  206. </a-table>
  207. </div>
  208. <!-- tabs 合计 信息 -->
  209. <div style="marginTop:30px;">
  210. <h6 class="table-title">合计信息</h6>
  211. <div style="border: 1px solid #e8e8e8;padding: 20px 20px 0 20px;">
  212. <a-row :gutter="24">
  213. <div class="table-page-search-wrapper">
  214. <a-form layout="inline" class="kk">
  215. <a-col :md="6" :sm="8">
  216. <a-form-item label="出货数量合计" >
  217. <span >{{sumInfo.shipQua}}</span>
  218. </a-form-item>
  219. </a-col>
  220. <a-col :md="6" :sm="8">
  221. <a-form-item label="辅料金额合计">
  222. <span >{{sumInfo.ingAmount}}</span>
  223. </a-form-item>
  224. </a-col>
  225. <a-col :md="6" :sm="8">
  226. <a-form-item label="辅料不含税金额合计" >
  227. <span >{{sumInfo.ingExcludAmount}}</span>
  228. </a-form-item>
  229. </a-col>
  230. <a-col :md="6" :sm="8">
  231. <a-form-item label="出运美元外销总价" >
  232. <span>{{sumInfo.exportPriceUSD}}</span>
  233. </a-form-item>
  234. </a-col>
  235. <a-col :md="6" :sm="8">
  236. <a-form-item label="出运加工费">
  237. <span >{{sumInfo.shipProcesFees}}</span>
  238. </a-form-item>
  239. </a-col>
  240. <a-col :md="6" :sm="8">
  241. <a-form-item label="面料不含税金额合计">
  242. <span>{{sumInfo.fabricExcludTax}}</span>
  243. </a-form-item>
  244. </a-col>
  245. <a-col :md="6" :sm="8">
  246. <a-form-item label="出运人民币外销金额">
  247. <span >{{sumInfo.exportedAmountRMB}}</span>
  248. </a-form-item>
  249. </a-col>
  250. <a-col :md="6" :sm="8">
  251. <a-form-item label="合计金额">
  252. <span >{{sumInfo.amountTotal}}</span>
  253. </a-form-item>
  254. </a-col>
  255. <a-col :md="6" :sm="8">
  256. <a-form-item label="面料金额合计" >
  257. <span>{{sumInfo.fabricAmount}}</span>
  258. </a-form-item>
  259. </a-col>
  260. </a-form>
  261. </div>
  262. </a-row>
  263. </div>
  264. </div>
  265. </a-tab-pane>
  266. </a-tabs>
  267. <!-- <tabs ref="unitTabs" /> -->
  268. </div>
  269. </a-card>
  270. <!-- 事故单 -->
  271. <a-card :bordered="true" style="margin:10px 0">
  272. <div style="margin:60px 0 40px 0">
  273. <h6 class="table-title">事故单</h6>
  274. <a-table
  275. rowKey="id"
  276. :loading="loading"
  277. :columns="accidentListColumns"
  278. :data-source="accidentListData"
  279. bordered
  280. :pagination="false"
  281. :scroll="{ x: 1500,y:300 }"
  282. >
  283. </a-table>
  284. </div>
  285. <!-- 费用支出 -->
  286. <div>
  287. <h6 class="table-title">费用支出</h6>
  288. <a-table
  289. rowKey="id"
  290. :loading="loading"
  291. :columns="costPayColumns"
  292. :data-source="costPayData"
  293. :scroll="{ x: 1500,y:300 }"
  294. bordered
  295. :pagination="false"
  296. >
  297. </a-table>
  298. </div>
  299. <!-- 备注信息 根据角色权限控制【填写】、【查看】-->
  300. <div class="note-one" style="marginTop:40px;">
  301. <h6 class="table-title">备注信息</h6>
  302. <div class="noteDetail">
  303. {{ detailsPlanNum.remarks }}
  304. </div>
  305. </div>
  306. </a-card>
  307. </div>
  308. </template>
  309. <script>
  310. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  311. import JEllipsis from '@/components/jeecg/JEllipsis'
  312. import moment from 'moment'
  313. import { costByPlanNum } from '@api/document/cost-allocation-total.js'
  314. export default {
  315. name: 'CostDetailDrawer', // 详情抽屉
  316. mixins: [JeecgListMixin],
  317. components: { JEllipsis, moment },
  318. data() {
  319. return {
  320. loading: false, // 表格加载
  321. detailsPlanNum: {}, //详情所有数据
  322. remarks: '', // 备注
  323. // 事故单 表头
  324. accidentListColumns: [
  325. {
  326. title: '单号',
  327. width: 120,
  328. dataIndex: 'accidentNum',
  329. className: 'replacecolor',
  330. },
  331. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker',ellipsis: true, className: 'replacecolor' },
  332. { title: '金额', dataIndex: 'amount', width: 120,ellipsis: true, className: 'replacecolor' }
  333. ],
  334. accidentListData: [],
  335. // 费用支出 表头
  336. costPayColumns: [
  337. { title: '账套号', width: 120, dataIndex: 'setNo',ellipsis: true, className: 'replacecolor' },
  338. { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo',ellipsis: true, className: 'replacecolor' },
  339. { title: '费用项目', dataIndex: 'expenseItem', width: 120,ellipsis: true, className: 'replacecolor' },
  340. { title: ' 支出本币金额', dataIndex: 'disbursedLocalmoney', width: 120,ellipsis: true, className: 'replacecolor' },
  341. { title: '支出原币金额', dataIndex: 'disbursedOriginalmoney', width: 120,ellipsis: true, className: 'replacecolor' },
  342. { title: '发票号', dataIndex: 'invoicenum', width: 120,ellipsis: true, className: 'replacecolor' },
  343. { title: '制单人', dataIndex: 'preparedBy', width: 120,ellipsis: true, className: 'replacecolor' }
  344. ],
  345. // 面料
  346. fabColumns: [
  347. {
  348. title: '序号',
  349. width: 90,
  350. dataIndex: 'index',
  351. key: 'index',
  352. customRender: (text, record, index) => `${index + 1}`,
  353. className: 'replacecolor'
  354. },
  355. { title: '货物名称', width: 160, dataIndex: 'goodsName',ellipsis: true, className: 'replacecolor' },
  356. {
  357. title: '转入数量',
  358. dataIndex: 'fabrictransferQuantity',
  359. width: 120,
  360. ellipsis: true,
  361. className: 'replacecolor',
  362. },
  363. {
  364. title: '转入成本',
  365. dataIndex: 'transferCost',
  366. width: 120,
  367. ellipsis: true,
  368. className: 'replacecolor',
  369. // slots:{title:'transferCostTitle'} ,
  370. },
  371. { title: '单耗/件', dataIndex: 'unitConsumption', width: 120,ellipsis: true, className: 'replacecolor' },
  372. { title: '使用数量', dataIndex: 'usageQuantity', width: 120,ellipsis: true, className: 'replacecolor' },
  373. { title: '计划数量', dataIndex: 'planQuantity', width: 120,ellipsis: true, className: 'replacecolor' },
  374. {
  375. title: '购入数量',
  376. dataIndex: 'purchaseQuantity',
  377. ellipsis: true,
  378. width: 120,
  379. className: 'replacecolor'
  380. },
  381. {
  382. title: '余下数量',
  383. dataIndex: 'fabricremainingQuantity',
  384. ellipsis: true,
  385. width: 100,
  386. className: 'replacecolor',
  387. },
  388. {
  389. title: '损耗',
  390. dataIndex: 'loss',
  391. ellipsis: true,
  392. width: 120,
  393. className: 'replacecolor'
  394. },
  395. {
  396. title: '余下数量的成本',
  397. dataIndex: 'remainingQuantitycost',
  398. ellipsis: true,
  399. width: 120,
  400. className: 'replacecolor',
  401. }
  402. ],
  403. // 辅料
  404. ingColumns: [
  405. {
  406. title: '序号',
  407. width: 90,
  408. dataIndex: 'index',
  409. key: 'index',
  410. fixed: 'left',
  411. customRender: (text, record, index) => `${index + 1}`,
  412. className: 'replacecolor'
  413. },
  414. { title: '货物名称', width: 200, dataIndex: 'goodsName', fixed: 'left',ellipsis: true, className: 'replacecolor' },
  415. {
  416. title: '转入数量',
  417. dataIndex: 'ingredientsTransferQuantity',
  418. width: 150,
  419. ellipsis: true,
  420. className: 'replacecolor',
  421. },
  422. {
  423. title: '转入成本',
  424. dataIndex: 'transferCost',
  425. width: 130,
  426. ellipsis: true,
  427. className: 'replacecolor',
  428. // slots:{title:'transferCostTitle'} ,
  429. },
  430. { title: '使用数量', dataIndex: 'usageQuantity',ellipsis: true, width: 120, className: 'replacecolor' },
  431. {
  432. title: '购入数量',
  433. dataIndex: 'purchaseQuantity',
  434. width: 120,
  435. ellipsis: true,
  436. className: 'replacecolor'
  437. },
  438. {
  439. title: '余下数量',
  440. dataIndex: 'ingredientsRemainingQuantity',
  441. width: 140,
  442. ellipsis: true,
  443. className: 'replacecolor',
  444. },
  445. {
  446. title: '损耗',
  447. dataIndex: 'loss',
  448. width: 120,
  449. ellipsis: true,
  450. className: 'replacecolor'
  451. },
  452. {
  453. title: '人民币金额',
  454. dataIndex: 'rmbAmount',
  455. width: 160,
  456. ellipsis: true,
  457. className: 'replacecolor'
  458. },
  459. {
  460. title: '美元金额',
  461. dataIndex: 'usdAmount',
  462. width: 160,
  463. ellipsis: true,
  464. className: 'replacecolor',
  465. customRender: (text, record, index) => {
  466. if (record.rmbAmount == record.usdAmount)
  467. return "";
  468. else
  469. return record.usdAmount;
  470. }
  471. },
  472. {
  473. title: '不含税金额',
  474. dataIndex: 'priceExcludingtax',
  475. width: 120,
  476. ellipsis: true,
  477. className: 'replacecolor'
  478. },
  479. {
  480. title: '用量',
  481. dataIndex: 'dosage',
  482. width: 120,
  483. ellipsis: true,
  484. className: 'replacecolor'
  485. }
  486. ],
  487. // 发运明细
  488. shipColumns: [
  489. {
  490. title: '序号',
  491. width: 80,
  492. dataIndex: 'index',
  493. key: 'index',
  494. fixed: 'left',
  495. ellipsis: true,
  496. customRender: (text, record, index) => `${index + 1}`,
  497. className: 'replacecolor'
  498. },
  499. { title: '发票号码', width: 150, dataIndex: 'invoiceNum', fixed: 'left',ellipsis: true, className: 'replacecolor' },
  500. {
  501. title: '出运日期',
  502. dataIndex: 'outdata',
  503. width: 120,
  504. fixed: 'left',
  505. ellipsis: true,
  506. className: 'replacecolor'
  507. },
  508. {
  509. title: '小po',
  510. width: 90,
  511. dataIndex: 'smallPo',
  512. fixed: 'left',
  513. ellipsis: true,
  514. className: 'replacecolor'
  515. },
  516. {
  517. title: '汇率',
  518. dataIndex: 'exchangeRate',
  519. width: 90,
  520. ellipsis: true,
  521. className: 'replacecolor'
  522. },
  523. { title: '订单号', dataIndex: 'orderNum', width: 180,ellipsis: true, className: 'replacecolor' },
  524. {
  525. title: '产品款号',
  526. dataIndex: 'poStyleNum',
  527. width: 220,
  528. ellipsis: true,
  529. className: 'replacecolor'
  530. },
  531. {
  532. title: '出货数量',
  533. dataIndex: 'shipQuantity',
  534. width: 100,
  535. ellipsis: true,
  536. className: 'replacecolor'
  537. },
  538. {
  539. title: '外销单价',
  540. dataIndex: 'exportUnitPrice',
  541. width: 100,
  542. ellipsis: true,
  543. className: 'replacecolor'
  544. },
  545. {
  546. title: '外销总价',
  547. dataIndex: 'exportPrice',
  548. width: 100,
  549. ellipsis: true,
  550. className: 'replacecolor'
  551. },
  552. {
  553. title: '人民币金额',
  554. dataIndex: 'rmbAmount',
  555. width: 120,
  556. ellipsis: true,
  557. className: 'replacecolor'
  558. },
  559. {
  560. title: '加工单价(人民币)',
  561. dataIndex: 'procesUnitPricermb',
  562. width: 150,
  563. ellipsis: true,
  564. className: 'replacecolor'
  565. },
  566. {
  567. title: '加工单价(美元)',
  568. dataIndex: 'procesUnitPriceusd',
  569. width: 150,
  570. ellipsis: true,
  571. className: 'replacecolor',
  572. customRender: (text, record, index) => {
  573. if (record.procesUnitPricermb == record.procesUnitPriceusd)
  574. return "";
  575. else
  576. return record.procesUnitPriceusd;
  577. }
  578. },
  579. {
  580. title: '加工费',
  581. dataIndex: 'processCost',
  582. width: 100,
  583. ellipsis: true,
  584. className: 'replacecolor'
  585. }
  586. ],
  587. shipData: [],
  588. ingData: [],
  589. fabData: [],
  590. sumInfo: {} ,//合计对象
  591. costPayData: [],
  592. tabNameList:[],
  593. tabsAllData: [],
  594. isView:false,
  595. visible: false,
  596. activeKey: '0',
  597. record: {} //点击的计划单号
  598. }
  599. },
  600. created(){
  601. var ccode = this.$route.query.ccode;
  602. if (ccode != undefined && ccode != ""){
  603. this.planNum = ccode;
  604. // this.showSelect=1;
  605. this.isView = true;
  606. this.getALLDetail(this.planNum,'0');
  607. }
  608. },
  609. methods: {
  610. // 详情所有数据
  611. getALLDetail(planNum) {
  612. this.$nextTick(() => {
  613. // console.log('详情拿到planNum', this.record.planNum)
  614. costByPlanNum({ plannum:planNum, type: 'queryNew' }).then(res => {
  615. if (res.success) {
  616. this.detailsPlanNum = res.result //所有详情
  617. this.accidentListData = res.result.syCostAllocationAccidentList //事故单
  618. this.accidentCalculation(this.accidentListData)
  619. var accidentNum = 0
  620. this.accidentListData.map(item =>{
  621. item.id = accidentNum + 1
  622. accidentNum += 1
  623. })
  624. this.costPayData = res.result.syCostAllocationCostpayList //支出费用
  625. var num = 0
  626. this.costPayData.map(item =>{
  627. item.id = num + 1
  628. num += 1
  629. })
  630. this.tabNameList = res.result.processUnit.split(',')
  631. this.tabsAllData = res.result.processUnitList
  632. var oneData = this.tabsAllData[0]
  633. this.fabData = oneData.syCostAllocationFabricList
  634. this.fabData.map(item=>{
  635. if(item.remainingQuantitycost!=='' && item.remainingQuantitycost){
  636. item.remainingQuantitycost = item.remainingQuantitycost.toFixed(2)
  637. }
  638. })
  639. this.ingData = oneData.syCostAllocationIngredientList
  640. this.shipData = oneData.syCostAllocationShipdetail
  641. this.calculation(oneData.syCostAllocationShipdetail)
  642. //合计中面料相关金额
  643. var s=0
  644. oneData.syCostAllocationFabricList.map(item=>{
  645. s+=Number(item.transferCost)
  646. })
  647. this.sumInfo.fabricAmount =(this.detailsPlanNum.fabriccostIncludestax!==''&&this.detailsPlanNum.fabriccostIncludestax)?(this.detailsPlanNum.fabriccostIncludestax).toFixed(3):''//合计中的面料总额
  648. this.sumInfo.fabricExcludTax = (s/1.13).toFixed(3)//合计中的不含税面料总额
  649. //合计中辅料相关金额
  650. var s = 0,
  651. v =0
  652. oneData.syCostAllocationIngredientList.map(item=>{
  653. s+=Number(item.priceExcludingtax),
  654. v+=Number(item.rmbAmount)
  655. })
  656. this.sumInfo.ingExcludAmount = s.toFixed(3),//辅料不含税金额合计
  657. this.sumInfo.ingAmount =v.toFixed(3)//辅料金额合计
  658. //合计中出运明细相关金额
  659. var s =0,
  660. v = 0,
  661. d = 0,
  662. b = 0,
  663. f=0
  664. oneData.syCostAllocationShipdetail.map(item=>{
  665. s+=Number(item.exportPrice)
  666. v+=Number(item.shipQuantity)
  667. d+=Number(item.processCost)
  668. b+=Number(item.exportPrice)
  669. })
  670. this.sumInfo.exportPriceUSD = s.toFixed(3)//出运美元外销总价
  671. this.sumInfo.shipQua =v.toFixed(3)//出货数量合计
  672. this.sumInfo.shipProcesFees =d.toFixed(3)//出运加工费
  673. this.sumInfo.exportedAmountRMB =b.toFixed(3)//出运人民币外销金额 f
  674. f=Number(this.sumInfo.ingAmount)+Number(this.sumInfo.shipProcesFees)
  675. this.sumInfo.amountTotal =f.toFixed(3)//合计金额
  676. this.pagination = {
  677. total: res.result.total,
  678. current: res.result.current,
  679. pageSize: res.result.size
  680. }
  681. }
  682. })
  683. })
  684. },
  685. //计算短出货值
  686. calculation(val){
  687. var average = 0
  688. val.map(item=>{
  689. average += Number(item.exportUnitPrice)
  690. })
  691. this.detailsPlanNum.shortvalue = (this.detailsPlanNum.shortseveral*average).toFixed(3)
  692. var shipQuantityAll =0,
  693. exportUnitPriceALll = 0,
  694. exportPriceAll =0,
  695. rmbAmountAll = 0,
  696. procesUnitPricermbAll = 0,
  697. procesUnitPriceusdAll = 0,
  698. processCostAll = 0
  699. val.map(item=>{
  700. shipQuantityAll+=Number(item.shipQuantity)
  701. exportUnitPriceALll+=Number(item.exportUnitPrice)
  702. exportPriceAll+=Number(item.exportPrice)
  703. rmbAmountAll+=Number(item.rmbAmount)
  704. procesUnitPricermbAll+=Number(item.procesUnitPricermb)
  705. procesUnitPriceusdAll+=Number(item.procesUnitPriceusd)
  706. processCostAll+=Number(item.processCost)
  707. })
  708. var allObj ={
  709. outdata:'合计',
  710. shipQuantity:shipQuantityAll.toFixed(3),
  711. exportUnitPrice:exportUnitPriceALll.toFixed(3),
  712. exportPrice:exportPriceAll.toFixed(3),
  713. rmbAmount:rmbAmountAll.toFixed(3),
  714. procesUnitPricermb:procesUnitPricermbAll.toFixed(3),
  715. procesUnitPriceusd:procesUnitPriceusdAll.toFixed(3),
  716. processCost:processCostAll.toFixed(3)
  717. }
  718. this.shipData.push(allObj)
  719. },
  720. //计算事故单美元金额和事故单人民币金额
  721. accidentCalculation(val){
  722. var usaMoney = 0,
  723. rmbMoney = 0
  724. val.map(item=>{
  725. usaMoney += item.amount,
  726. rmbMoney+=item.rmbAmount
  727. })
  728. this.detailsPlanNum.accidentUsdamount = usaMoney
  729. this.detailsPlanNum.accidentcnyAmount = usaMoney
  730. },
  731. tabsCallback(key) {
  732. this.activeKey = key
  733. // console.log('点击的是', this.activeKey)
  734. if (key == 0) {
  735. var oneData = this.tabsAllData[0]
  736. this.fabData = oneData.syCostAllocationFabricList
  737. this.ingData = oneData.syCostAllocationIngredientList
  738. this.shipData = oneData.syCostAllocationShipdetailList
  739. }
  740. if (key == 1) {
  741. var twoData = this.tabsAllData[1]
  742. this.fabData = twoData.syCostAllocationFabricList
  743. this.ingData = twoData.syCostAllocationIngredientList
  744. this.shipData = twoData.syCostAllocationShipdetailList
  745. }
  746. },
  747. onClose() {
  748. this.visible = false
  749. },
  750. // --------------------------------------------------
  751. // father 方法
  752. aa() {},
  753. bb() {},
  754. cc() {}
  755. }
  756. }
  757. </script>
  758. <style lang="less" scoped>
  759. @import '~@assets/less/common.less';
  760. @import '~@assets/less/overwriter.less';
  761. /deep/ .ant-table-thead > tr > th {
  762. text-align: center;
  763. // font-weight: 700;
  764. }
  765. /deep/ .ant-table-tbody {
  766. text-align: center;
  767. }
  768. // /deep/ th.replacecolor {
  769. // background-color: #ccc;
  770. // }
  771. // 抽屉里的card样式
  772. /deep/ .ant-drawer-content {
  773. background-color: #f0f2f5;
  774. }
  775. /deep/ .ant-drawer-body {
  776. padding: 10px;
  777. }
  778. // 回显label文字
  779. /deep/.ant-form-item-label > label {
  780. font-weight: 700;
  781. color: #333;
  782. }
  783. </style>