tabs.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <template>
  2. <!-- 报表 - tabs -->
  3. <!-- default-active-key="1"-->
  4. <div id="unitTabs">
  5. <a-tabs @change="tabsCallback" :default-active-key="activeKey">
  6. <a-tab-pane v-for="(item, index) in tabNameList" :key="index" :tab="item">
  7. <!-- tabs 面料 -->
  8. <div :class="[(fabData.length==0?'noprint': '')]">
  9. <h6 class="table-title">面料</h6>
  10. <a-table
  11. rowKey="(item)=>item.id"
  12. :loading="loading"
  13. :columns="fabColumns"
  14. :data-source="fabData"
  15. bordered
  16. :pagination="false"
  17. :scroll="{ x: 1500 }"
  18. >
  19. <!-- 表头 -->
  20. <span slot="transferCostTitle" class="fontColor">
  21. 转入成本
  22. </span>
  23. <span slot="remainingQuantitycostTitle" class="fontColor">
  24. 余下数量的成本
  25. </span>
  26. <!-- 面料 -转入数量 弹框-->
  27. <span slot="fabInQuaSlot" slot-scope="text">
  28. <a>{{ text }}</a>
  29. </span>
  30. <!-- 余下数量-->
  31. <span slot="fabRemaQuaSlot" slot-scope="text">
  32. <a>{{ text }}</a>
  33. </span>
  34. </a-table>
  35. </div>
  36. <!-- tabs 辅料 -->
  37. <div style="margin:30px 0" :class="[(ingData.length==0?'noprint': '')]">
  38. <h6 class="table-title">辅料</h6>
  39. <a-table
  40. rowKey="(item)=>item.id"
  41. :loading="loading"
  42. :columns="ingColumns"
  43. :data-source="ingData"
  44. bordered
  45. :pagination="false"
  46. :scroll="{ x: 1500 }"
  47. >
  48. <!-- 表头 -->
  49. <span slot="transferCostTitle" class="fontColor">
  50. 转入成本
  51. </span>
  52. <!--辅料-转入数量 弹框-->
  53. <span slot="ingInQuaSlot" slot-scope="text">
  54. <a>{{ text }}</a>
  55. </span>
  56. <!--辅料-余下数量 弹框-->
  57. <span slot="ingRemQuaSlot" slot-scope="text">
  58. <a>{{ text }}</a>
  59. </span>
  60. </a-table>
  61. </div>
  62. <!-- tabs 发运明细 :scroll="{ x: 1500 }"-->
  63. <div :class="[(shipData.length==0?'noprint': '')]">
  64. <h6 class="table-title">发运明细</h6>
  65. <a-table
  66. rowKey="(item)=>item.id"
  67. :loading="loading"
  68. :columns="shipColumns"
  69. :data-source="shipData"
  70. bordered
  71. :pagination="false"
  72. :scroll="{ x: 1500 }"
  73. class="shipData"
  74. >
  75. </a-table>
  76. </div>
  77. <!-- tabs 合计 信息 -->
  78. <div style="marginTop:30px;">
  79. <h6 class="table-title">合计信息</h6>
  80. <div style="border: 1px solid #e8e8e8;padding: 20px 20px 0 20px;">
  81. <a-row :gutter="24">
  82. <div class="table-page-search-wrapper">
  83. <a-form layout="inline" class="kk">
  84. <a-col :md="6" :sm="8">
  85. <a-form-item label="出货数量合计" >
  86. <a-input v-model="sumInfo.shipQua" v-show='showSelect==0'></a-input>
  87. <span v-show='showSelect==1'>{{sumInfo.shipQua}}</span>
  88. </a-form-item>
  89. </a-col>
  90. <a-col :md="6" :sm="8">
  91. <a-form-item label="出运美元外销总价" >
  92. <a-input v-model="sumInfo.exportPriceUSD" v-show='showSelect==0'></a-input>
  93. <span v-show='showSelect==1'>{{sumInfo.exportPriceUSD}}</span>
  94. </a-form-item>
  95. </a-col>
  96. <a-col :md="6" :sm="8">
  97. <a-form-item label="出运人民币外销金额">
  98. <a-input v-model="sumInfo.exportedAmountRMB" v-show='showSelect==0'></a-input>
  99. <span v-show='showSelect==1'>{{sumInfo.exportedAmountRMB}}</span>
  100. </a-form-item>
  101. </a-col>
  102. <a-col :md="6" :sm="8">
  103. <a-form-item label="成本合计金额">
  104. <a-input v-model="sumInfo.amountTotal" v-show='showSelect==0'></a-input>
  105. <span v-show='showSelect==1'>{{sumInfo.amountTotal}}</span>
  106. </a-form-item>
  107. </a-col>
  108. <a-col :md="6" :sm="8">
  109. <a-form-item label="面料金额合计" >
  110. <a-input v-model="sumInfo.fabricAmount" v-show='showSelect==0'></a-input>
  111. <span v-show='showSelect==1'>{{sumInfo.fabricAmount}}</span>
  112. </a-form-item>
  113. </a-col>
  114. <a-col :md="6" :sm="8">
  115. <a-form-item label="辅料金额合计">
  116. <a-input v-model="sumInfo.ingAmount" v-show='showSelect==0'></a-input>
  117. <span v-show='showSelect==1'>{{sumInfo.ingAmount}}</span>
  118. </a-form-item>
  119. </a-col>
  120. <a-col :md="6" :sm="8">
  121. <a-form-item label="出运加工费">
  122. <a-input v-model="sumInfo.shipProcesFees" v-show='showSelect==0'></a-input>
  123. <span v-show='showSelect==1'>{{sumInfo.shipProcesFees}}</span>
  124. </a-form-item>
  125. </a-col>
  126. <a-col :md="6" :sm="8" class="noprint">
  127. <a-form-item ></a-form-item>
  128. </a-col>
  129. <a-col :md="6" :sm="8">
  130. <a-form-item label="面料不含税金额合计">
  131. <a-input v-model="sumInfo.fabricExcludTax" v-show='showSelect==0'></a-input>
  132. <span v-show='showSelect==1'>{{sumInfo.fabricExcludTax}}</span>
  133. </a-form-item>
  134. </a-col>
  135. <a-col :md="6" :sm="8">
  136. <a-form-item label="辅料不含税金额合计" >
  137. <a-input v-model="sumInfo.ingExcludAmount" v-show='showSelect==0'></a-input>
  138. <span v-show='showSelect==1'>{{sumInfo.ingExcludAmount}}</span>
  139. </a-form-item>
  140. </a-col>
  141. </a-form>
  142. </div>
  143. </a-row>
  144. </div>
  145. </div>
  146. </a-tab-pane>
  147. </a-tabs>
  148. <!-- tabs内弹框 -->
  149. <div>
  150. <!-- 面料 转入数量 -->
  151. <fabInQua-modal ref="fabInQuaModal" :father="aa"></fabInQua-modal>
  152. <!-- 余下数量 -->
  153. <fabRemQua-modal ref="fabRemQuaModal" :father="bb"></fabRemQua-modal>
  154. <!-- 辅料 转入数量 -->
  155. <ingInQua-modal ref="ingInQuaModal" :father="cc"></ingInQua-modal>
  156. <!-- 余下数量 -->
  157. <ingRemQua-modal ref="ingRemQuaModal" :father="bb"></ingRemQua-modal>
  158. </div>
  159. </div>
  160. </template>
  161. <script>
  162. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  163. import JEllipsis from '@/components/jeecg/JEllipsis'
  164. import moment from 'moment'
  165. import fabInQuaModal from '@views/cost-allocation-total/modal/fabInQuaModal.vue'
  166. import fabRemQuaModal from '@views/cost-allocation-total/modal/fabRemQuaModal.vue'
  167. import ingInQuaModal from '@views/cost-allocation-total/modal/ingInQuaModal.vue'
  168. import ingRemQuaModal from '@views/cost-allocation-total/modal/ingRemQuaModal.vue'
  169. export default {
  170. name: 'UnitTabs', // Tabs 详情
  171. mixins: [JeecgListMixin],
  172. components: {
  173. JEllipsis,
  174. moment,
  175. fabInQuaModal, // 面料 转入数量
  176. fabRemQuaModal, // 余下数量
  177. ingInQuaModal, // 辅料 转入数量
  178. ingRemQuaModal // 余下数量
  179. },
  180. data() {
  181. // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  182. return {
  183. // 面料
  184. fabColumns: [
  185. {
  186. title: '序号',
  187. width: '6%',
  188. dataIndex: 'index',
  189. key: 'index',
  190. customRender: (text, record, index) => `${index + 1}`,
  191. className: 'replacecolor'
  192. },
  193. { title: '货物名称', width: '10%', dataIndex: 'goodsName', className: 'replacecolor' },
  194. {
  195. title: '转入数量',
  196. dataIndex: 'fabrictransferQuantity',
  197. width: '10%',
  198. className: 'replacecolor',
  199. customCell: this.fabQuaCustomCell,
  200. scopedSlots: { customRender: 'fabInQuaSlot' },
  201. },
  202. {
  203. title: '转入成本',
  204. dataIndex: 'transferCost',
  205. width: '10%',
  206. className: 'replacecolor',
  207. // slots:{title:'transferCostTitle'} ,
  208. },
  209. { title: '单耗/件', dataIndex: 'unitConsumption', width: '10%', className: 'replacecolor' },
  210. { title: '使用数量', dataIndex: 'usageQuantity', width: '10%', className: 'replacecolor' },
  211. { title: '计划数量', dataIndex: 'planQuantity', width: '10%', className: 'replacecolor' },
  212. {
  213. title: '购入数量',
  214. dataIndex: 'purchaseQuantity',
  215. width: '10%',
  216. className: 'replacecolor'
  217. },
  218. {
  219. title: '余下数量',
  220. dataIndex: 'fabricremainingQuantity',
  221. width: '7%',
  222. className: 'replacecolor',
  223. customCell: this.fabRemQuaCustomCell,
  224. scopedSlots: { customRender: 'fabRemaQuaSlot' }
  225. },
  226. {
  227. title: '损耗',
  228. dataIndex: 'loss',
  229. width: '10%',
  230. className: 'replacecolor'
  231. },
  232. {
  233. title: '余下数量的成本',
  234. dataIndex: 'remainingQuantitycost',
  235. width: '10%',
  236. className: 'replacecolor',
  237. // slots:{title:'remainingQuantitycostTitle'} ,
  238. }
  239. ],
  240. fabData: [],
  241. // 辅料
  242. ingColumns: [
  243. {
  244. title: '序号',
  245. width: '6%',
  246. dataIndex: 'index',
  247. key: 'index',
  248. fixed: 'left',
  249. customRender: (text, record, index) =>{
  250. if(record.goodsName!=='合计'){
  251. return index + 1
  252. }else{
  253. return ''
  254. }
  255. },
  256. className: 'replacecolor'
  257. },
  258. { title: '货物名称', width: '12%', dataIndex: 'goodsName', fixed: 'left', className: 'replacecolor' },
  259. {
  260. title: '转入数量',
  261. dataIndex: 'ingredientsTransferQuantity',
  262. width: '10%',
  263. className: 'replacecolor',
  264. customCell: this.ingInQuaCustomCell,
  265. scopedSlots: { customRender: 'ingInQuaSlot' }
  266. },
  267. {
  268. title: '转入成本',
  269. dataIndex: 'transferCost',
  270. width: '10%',
  271. className: 'replacecolor',
  272. // slots:{title:'transferCostTitle'} ,
  273. },
  274. { title: '使用数量', dataIndex: 'usageQuantity', width: '8%', className: 'replacecolor' },
  275. {
  276. title: '购入数量',
  277. dataIndex: 'purchaseQuantity',
  278. width: '10%',
  279. className: 'replacecolor'
  280. },
  281. {
  282. title: '余下数量',
  283. dataIndex: 'ingredientsRemainingQuantity',
  284. width: '9%',
  285. className: 'replacecolor',
  286. customCell: this.ingRemQuaCustomCell,
  287. scopedSlots: { customRender: 'ingRemQuaSlot' }
  288. },
  289. {
  290. title: '损耗',
  291. dataIndex: 'loss',
  292. width: '8%',
  293. className: 'replacecolor'
  294. },
  295. {
  296. title: '人民币金额',
  297. dataIndex: 'rmbAmount',
  298. width: '8%',
  299. className: 'replacecolor'
  300. },
  301. {
  302. title: '美元金额',
  303. dataIndex: 'usdAmount',
  304. width: '8%',
  305. className: 'replacecolor',
  306. customRender: (text, record, index) => {
  307. if (record.rmbAmount == record.usdAmount)
  308. return "";
  309. else
  310. return record.usdAmount;
  311. }
  312. },
  313. {
  314. title: '不含税金额',
  315. dataIndex: 'priceExcludingtax',
  316. width: '8%',
  317. className: 'replacecolor'
  318. },
  319. // {
  320. // title: '转出率',
  321. // dataIndex: 'transferOutrate',
  322. // width: 120,
  323. // className: 'replacecolor'
  324. // },
  325. // {
  326. // title: '进项税转出',
  327. // dataIndex: 'inputtaxTransferout',
  328. // width: 160,
  329. // className: 'replacecolor'
  330. // },
  331. {
  332. title: '用量',
  333. dataIndex: 'dosage',
  334. width: '8%',
  335. className: 'replacecolor'
  336. }
  337. ],
  338. ingData: [],
  339. // 发运明细
  340. shipColumns: [
  341. {
  342. title: '序号',
  343. width: '6%',
  344. dataIndex: 'index',
  345. key: 'index',
  346. fixed: 'left',
  347. customRender: (text, record, index) => `${index + 1}`,
  348. className: 'replacecolor'
  349. },
  350. { title: '发票号码', width: '15%', dataIndex: 'invoiceNum', fixed: 'left', className: 'replacecolor' },
  351. {
  352. title: '出运日期',
  353. dataIndex: 'outdata',
  354. width: '8%',
  355. fixed: 'left',
  356. className: 'replacecolor'
  357. },
  358. {
  359. title: '小po',
  360. width: '7%',
  361. dataIndex: 'smallPo',
  362. fixed: 'left',
  363. className: 'replacecolor'
  364. },
  365. {
  366. title: '汇率',
  367. dataIndex: 'exchangeRate',
  368. width: '8%',
  369. className: 'replacecolor'
  370. },
  371. { title: '订单号', dataIndex: 'orderNum', width: '10%', className: 'replacecolor' },
  372. {
  373. title: '产品款号',
  374. dataIndex: 'poStyleNum',
  375. width: '9%',
  376. className: 'replacecolor'
  377. },
  378. {
  379. title: '出货数量',
  380. dataIndex: 'shipQuantity',
  381. width: '9%',
  382. className: 'replacecolor'
  383. },
  384. {
  385. title: '外销单价',
  386. dataIndex: 'exportUnitPrice',
  387. width: '9%',
  388. className: 'replacecolor'
  389. },
  390. {
  391. title: '外销总价',
  392. dataIndex: 'exportPrice',
  393. width: '9%',
  394. className: 'replacecolor'
  395. },
  396. {
  397. title: '人民币金额',
  398. dataIndex: 'rmbAmount',
  399. width: '9%',
  400. className: 'replacecolor'
  401. },
  402. {
  403. title: '加工单价(人民币)',
  404. dataIndex: 'procesUnitPricermb',
  405. width: '9%',
  406. className: 'replacecolor'
  407. },
  408. {
  409. title: '加工单价(美元)',
  410. dataIndex: 'procesUnitPriceusd',
  411. width: '9%',
  412. className: 'replacecolor',
  413. customRender: (text, record, index) => {
  414. if (record.procesUnitPricermb == record.procesUnitPriceusd)
  415. return "";
  416. else
  417. return record.procesUnitPriceusd;
  418. }
  419. },
  420. {
  421. title: '加工费(人民币)',
  422. dataIndex: 'processCost',
  423. width: '8%',
  424. className: 'replacecolor'
  425. }
  426. ],
  427. shipData: [],
  428. tabsAllData: [], //tabs所有数据集合
  429. tabNameList: [], //tabs数组集合
  430. activeKey: '0',
  431. sumInfo: {} //合计对象
  432. }
  433. },
  434. props: {
  435. showSelect: {
  436. type: String,
  437. default: null
  438. }
  439. },
  440. created() {},
  441. methods: {
  442. tabsCallback(key) {
  443. this.activeKey = key
  444. // console.log('点击的是', this.activeKey)
  445. if (key == 0) {
  446. var oneData = this.tabsAllData[0]
  447. this.fabData = oneData.syCostAllocationFabricList
  448. this.ingData = oneData.syCostAllocationIngredientList
  449. this.shipData = oneData.syCostAllocationShipdetailList
  450. }
  451. if (key == 1) {
  452. var twoData = this.tabsAllData[1]
  453. this.fabData = twoData.syCostAllocationFabricList
  454. this.ingData = twoData.syCostAllocationIngredientList
  455. this.shipData = twoData.syCostAllocationShipdetailList
  456. }
  457. },
  458. // 面料 -转入数量 弹框
  459. fabQuaCustomCell(record) {
  460. return {
  461. on: {
  462. click: event => {
  463. console.log('面料 - 转入数量')
  464. this.$refs.fabInQuaModal.fabInQuaModVis = true
  465. record.syTransfers.map(item=>{
  466. if(item.unitCost){
  467. item.unitCost = (item.unitCost).toFixed(3)
  468. }
  469. })
  470. this.$refs.fabInQuaModal.data = record.syTransfers
  471. }
  472. }
  473. }
  474. },
  475. // 面料 -余下数量 弹框
  476. fabRemQuaCustomCell(record) {
  477. return {
  478. on: {
  479. click: event => {
  480. console.log('面料 - 余下数量')
  481. this.$refs.fabRemQuaModal.fabRemQuaModVis = true
  482. this.$refs.fabRemQuaModal.data = record.syRemaining
  483. }
  484. }
  485. }
  486. },
  487. // 辅料-转入数量 弹框
  488. ingInQuaCustomCell(record) {
  489. return {
  490. on: {
  491. click: event => {
  492. console.log('辅料 - 转入数量')
  493. this.$refs.ingInQuaModal.ingInQuaModVis = true
  494. record.syTransfers.map(item=>{
  495. if(item.unitCost){
  496. item.unitCost = (item.unitCost).toFixed(3)
  497. }
  498. })
  499. this.$refs.ingInQuaModal.data = record.syTransfers
  500. }
  501. }
  502. }
  503. },
  504. // 辅料-余下数量 弹框
  505. ingRemQuaCustomCell(record) {
  506. return {
  507. on: {
  508. click: event => {
  509. console.log('辅料 - 余下数量')
  510. this.$refs.ingRemQuaModal.ingRemQuaModVis = true
  511. this.$refs.ingRemQuaModal.data = record.syRemaining
  512. }
  513. }
  514. }
  515. },
  516. aa() {},
  517. bb() {},
  518. cc() {}
  519. },
  520. computed: {
  521. // 合计数据
  522. // sumInfoSource() {}
  523. }
  524. }
  525. </script>
  526. <style lang="less" scoped>
  527. @import '~@assets/less/common.less';
  528. @import '~@assets/less/overwriter.less';
  529. /deep/ .ant-table-thead > tr > th {
  530. text-align: center;
  531. // font-weight: 700;
  532. }
  533. /deep/ .ant-table-tbody {
  534. text-align: center;
  535. }
  536. // /deep/ th.replacecolor {
  537. // background-color: #ccc;
  538. // }
  539. //tbas内 小标签
  540. .table-title {
  541. font-weight: 700;
  542. }
  543. .fontColor{
  544. color: red;
  545. }
  546. /deep/ .ant-tabs-nav .ant-tabs-tab-active {
  547. font-size: 18px;
  548. }
  549. /deep/ .ant-tabs-nav .ant-tabs-tab {
  550. font-size: 18px;
  551. }
  552. /deep/ .ant-tabs-nav .ant-tabs-tab {
  553. padding: 0 0 10px 0;
  554. }
  555. /deep/ .fontColor .ant-form-item-label > label{
  556. color: red !important;
  557. }
  558. /deep/.ant-table-fixed{
  559. width:18% !important
  560. }
  561. /deep/.shipData>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-content>.ant-table-fixed-left>.ant-table-body-outer>.ant-table-body-inner>.ant-table-fixed>{
  562. width:29% !important
  563. }
  564. </style>