tabs.vue 15 KB

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