tabs.vue 19 KB

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