fabric-loss-table.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <template>
  2. <!-- 面料损耗表 -->
  3. <div id="fabricLossTable" >
  4. <!-- 主要信息 点击搜索后 全部回显-->
  5. <a-card title="主要信息" >
  6. <a-row :gutter="24" >
  7. <div class="table-page-search-wrapper">
  8. <a-form-model layout="inline" ref="form" :model="fabricLoss" :rules="validatorRules">
  9. <a-col :md="6" :sm="8">
  10. <a-form-model-item label="计划单号">
  11. <a-input-search
  12. placeholder="请输入计划单号"
  13. enter-button
  14. @search="onSearch"
  15. />
  16. </a-form-model-item>
  17. </a-col>
  18. <a-col :md="6" :sm="8">
  19. <a-form-model-item label="款号" has-feedback>
  20. {{fabricLoss.cdefine22}}
  21. <!-- <a-input v-model="fabricLoss.styleNum"></a-input> -->
  22. </a-form-model-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-model-item label="计划员">
  26. {{fabricLoss.planner}}
  27. <!-- <a-input v-model="fabricLoss.planner"></a-input> -->
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-model-item label="成衣合同号">
  32. {{fabricLoss.contractNo}}
  33. <!-- <a-input v-model="fabricLoss.garmentContractNo"></a-input> -->
  34. </a-form-model-item>
  35. </a-col>
  36. <a-col :md="6" :sm="8">
  37. <a-form-model-item label="排单数量">
  38. {{fabricLoss.number}}
  39. <!-- <a-input v-model="fabricLoss.singleRowNum"></a-input> -->
  40. </a-form-model-item>
  41. </a-col>
  42. <a-col :md="6" :sm="8">
  43. <a-form-model-item label="业务员">
  44. {{fabricLoss.cpersonName}}
  45. <!-- <a-input v-model="fabricLoss.salesman"></a-input> -->
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :md="6" :sm="8">
  49. <a-form-model-item label="实际单件成本">
  50. {{fabricLoss.actualPrice}}
  51. <!-- <a-input v-model="fabricLoss.actualUnitCost"></a-input> -->
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-model-item label="实际出库数量">
  56. {{fabricLoss.outboundNumber}}
  57. <!-- <a-input v-model="fabricLoss.actualOutQuantity"></a-input> -->
  58. </a-form-model-item>
  59. </a-col>
  60. <a-col :md="6" :sm="8">
  61. <a-form-model-item label="制单人">
  62. {{fabricLoss.makingPeople}}
  63. <!-- <a-input v-model="fabricLoss.preparedBy"></a-input> -->
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :md="6" :sm="8">
  67. <a-form-model-item label="单件成本">
  68. {{fabricLoss.price}}
  69. <!-- <a-input v-model="fabricLoss.costPerUnit"></a-input> -->
  70. </a-form-model-item>
  71. </a-col>
  72. <a-col :md="6" :sm="8">
  73. <a-form-model-item label="查询日期">
  74. {{fabricLoss.dateTime}}
  75. <!-- <a-date-picker style="width: 100%" v-model="fabricLoss.queryDate"></a-date-picker> -->
  76. </a-form-model-item>
  77. </a-col>
  78. <a-col :md="6" :sm="8">
  79. <a-button type="primary">附件</a-button>
  80. </a-col>
  81. </a-form-model>
  82. </div>
  83. </a-row>
  84. </a-card>
  85. <!-- 子表 -->
  86. <a-card style="margin:10px 0;">
  87. <!-- 采购订单 -->
  88. <div class="purchase-order-table">
  89. <h6 class="table-title">采购订单</h6>
  90. <a-table
  91. :row-key="record => record.id"
  92. :loading="loading"
  93. :columns="purchaseOrderColumns"
  94. :data-source="fabricLoss.fabricPoOrderList"
  95. bordered
  96. :pagination="false"
  97. >
  98. <!-- 采购数量 弹框-->
  99. <span slot="purchaseQuantity" slot-scope="text">
  100. <a>{{ text }}</a>
  101. </span>
  102. <!-- 余纱 -->
  103. <span slot="surplusYarn" slot-scope="text">
  104. <a>{{ text }}</a>
  105. </span>
  106. <!-- 来源余纱 -->
  107. <span slot="fromSurplusYarn" slot-scope="text">
  108. <a>{{ text }}</a>
  109. </span>
  110. <!-- 其他入库的纱 -->
  111. <span slot="surplusYarn" slot-scope="text">
  112. <a>{{ text }}</a>
  113. </span>
  114. </a-table>
  115. </div>
  116. <!-- 委外订单国内 -->
  117. <div class="outsource-orders-table" style="margin:40px 0">
  118. <h6 class="table-title">委外订单国内</h6>
  119. <a-table :columns="outsourceOrderColumns" :data-source="fabricLoss.fabricOMOrderList1" bordered :pagination="false">
  120. <!-- 材料出库数量 -->
  121. <span slot="materialsOutQuantity" slot-scope="text">
  122. <a>{{ text }}</a>
  123. </span>
  124. <!-- 采购入库数量 -->
  125. <span slot="purchaseInQuantity" slot-scope="text">
  126. <a>{{ text }}</a>
  127. </span>
  128. </a-table>
  129. </div>
  130. <!-- 委外订单国外 -->
  131. <div class="outsourceOrder-abroad-table">
  132. <h6 class="table-title">委外订单国外</h6>
  133. <a-table
  134. :row-key="record => record.id"
  135. :loading="loading"
  136. :columns="outsourceOrderAbroadColumns"
  137. :data-source="fabricLoss.fabricOMOrderList2"
  138. bordered
  139. :pagination="false"
  140. >
  141. <!-- 材料出库数量 -->
  142. <span slot="materialsOutQuantityAbroad" slot-scope="text">
  143. <a>{{ text }}</a>
  144. </span>
  145. <!-- 采购入库数量 -->
  146. <span slot="purchaseInQuantityAbroad" slot-scope="text">
  147. <a>{{ text }}</a>
  148. </span>
  149. </a-table>
  150. </div>
  151. <!-- 成本发票 -->
  152. <div class="cost-invoice-table" style="margin:40px 0">
  153. <h6 class="table-title">成本发票</h6>
  154. <a-table
  155. :row-key="record => record.id"
  156. :loading="loading"
  157. :columns="costInvoiceColumns"
  158. :data-source="costInvoiceData"
  159. bordered
  160. :pagination="false"
  161. >
  162. </a-table>
  163. </div>
  164. <!-- 开票成本-面料 -->
  165. <div class="costInvoice-fabric-table">
  166. <h6 class="table-title">开票成本-面料</h6>
  167. <!-- ref="" -->
  168. <a-table
  169. :row-key="record => record.id"
  170. :loading="loading"
  171. :columns="costInvoiceFabricColumns"
  172. :data-source="costInvoiceFabricData"
  173. bordered
  174. :pagination="false"
  175. :footer="fabricFooterShow"
  176. >
  177. <!-- 发票号码明细 -->
  178. <span slot="invoiceNum" slot-scope="text">
  179. <a>{{ text }}</a>
  180. </span>
  181. </a-table>
  182. </div>
  183. <!-- 开票成本-成衣 -->
  184. <div class="costInvoice-clothes-table" style="margin:40px 0">
  185. <h6 class="table-title">开票成本-成衣</h6>
  186. <a-table
  187. :row-key="record => record.id"
  188. :loading="loading"
  189. :columns="costInvoiceClothesColumns"
  190. :data-source="costInvoiceClothesData"
  191. bordered
  192. :pagination="false"
  193. :footer="clothesFooterShow"
  194. >
  195. <!-- 发票数量 -->
  196. <span slot="clInvoiceQuantity" slot-scope="text">
  197. <a>{{ text }}</a>
  198. </span>
  199. </a-table>
  200. </div>
  201. <!-- 开票成本-辅料 -->
  202. <div class="costInvoice-ingredient-table">
  203. <h6 class="table-title">开票成本-辅料</h6>
  204. <a-table
  205. :row-key="record => record.id"
  206. :loading="loading"
  207. :columns="costInvoiceIngredientColumns"
  208. :data-source="costInvoiceIngredientData"
  209. bordered
  210. :pagination="false"
  211. >
  212. <!-- 发票数量 -->
  213. <span slot="ingredientsInvoiceQuantity" slot-scope="text">
  214. <a>{{ text }}</a>
  215. </span>
  216. </a-table>
  217. </div>
  218. <!-- 费用支出 -->
  219. <div class="costPay-table" style="margin:40px 0">
  220. <h6 class="table-title">费用支出</h6>
  221. <a-table
  222. :row-key="record => record.id"
  223. :loading="loading"
  224. :columns="costPayColumns"
  225. :data-source="costPayData"
  226. bordered
  227. :pagination="false"
  228. >
  229. </a-table>
  230. </div>
  231. <!-- 事故单 -->
  232. <div class="accidentBill-table">
  233. <h6 class="table-title">事故单</h6>
  234. <a-table
  235. :row-key="record => record.id"
  236. :loading="loading"
  237. :columns="accidentListColumns"
  238. :data-source="accidentListData"
  239. bordered
  240. :pagination="false"
  241. >
  242. <!-- 事故单 -->
  243. <span slot="accidentNum" slot-scope="text">
  244. <a>{{ text }}</a>
  245. </span>
  246. </a-table>
  247. </div>
  248. <!-- 备注信息 1 根据角色判断 显示备注 1 或备注 2-->
  249. <div class="note-one" style="marginTop:40px;">
  250. <h6 class="table-title">备注信息 1</h6>
  251. <div class="noteDetail">
  252. <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
  253. <a-form-model-item prop="noteOne">
  254. <a-input type="textarea" v-model="fabricLoss.noteOne" placeholder="请输入备注" style="minHeight:100px;" />
  255. </a-form-model-item>
  256. </a-form-model>
  257. </div>
  258. </div>
  259. <!-- 备注信息 2 根据角色判断 显示备注 1 或备注 2-->
  260. <!-- <div class="note-one" style="marginTop:40px;">
  261. <h6 class="table-title">备注信息 2</h6>
  262. <div class="noteDetail">
  263. <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
  264. <a-form-model-item prop="noteOne">
  265. <a-input
  266. type="textarea"
  267. v-model="fabricLoss.noteTwo"
  268. placeholder="请输入备注"
  269. style="minHeight:100px;"
  270. />
  271. </a-form-model-item>
  272. </a-form-model>
  273. </div>
  274. </div> -->
  275. <!-- 页面底部保存 -->
  276. <a-row :gutter="24" style="marginTop:40px;float:right">
  277. <a-col :md="12" :sm="12">
  278. <a-button type="primary" @click="save">
  279. 保存
  280. </a-button>
  281. </a-col>
  282. </a-row>
  283. <!-- 弹框 -->
  284. <div>
  285. <!-- 采购数量弹框 @ok="modalFormOk"-->
  286. <purchaseAmount-modal ref="purchaseAmountModal" :father="aa"></purchaseAmount-modal>
  287. <!-- 余纱 -->
  288. <surplusYarn-modal ref="surplusYarnModal" :father="bb"></surplusYarn-modal>
  289. <!-- 委外订单国内弹框 -->
  290. <materialsOutQuantity-modal ref="materialsOutQuantityModal" :father="cc"></materialsOutQuantity-modal>
  291. <!-- 采购入库数量弹框 -->
  292. <purchaseInQuantity-modal ref="purchaseInQuantityModal" :father="dd"></purchaseInQuantity-modal>
  293. <!-- 发票号码弹框 -->
  294. <invoiceNum-modal ref="invoiceNumModal" :father="ee"></invoiceNum-modal>
  295. <!-- 发票数量弹框 -->
  296. <invoiceQuantity-modal ref="invoiceQuantityModal" :father="ff"></invoiceQuantity-modal>
  297. <!-- 事故单 -->
  298. <accidentList-modal ref="accidentListModal" :father="gg"></accidentList-modal>
  299. </div>
  300. </a-card>
  301. </div>
  302. </template>
  303. <script>
  304. import PurchaseAmountModal from '@views/reportForms/fabric-loss-table/purchaseAmountModal.vue'
  305. import materialsOutQuantityModal from '@views/reportForms/fabric-loss-table/materialsOutQuantityModal.vue'
  306. import purchaseInQuantityModal from '@views/reportForms/fabric-loss-table/purchaseInQuantityModal.vue'
  307. import invoiceNumModal from '@views/reportForms/fabric-loss-table/invoiceNumModal.vue'
  308. import invoiceQuantityModal from '@views/reportForms/fabric-loss-table/invoiceQuantityModal.vue'
  309. import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue'
  310. import surplusYarnModal from '@views/reportForms/fabric-loss-table/surplusYarnModal.vue'
  311. import { getFabricLossDatas } from '@api/reportForms/fabric-loss-table'
  312. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  313. import JEllipsis from '@/components/jeecg/JEllipsis'
  314. import moment from 'moment'
  315. export default {
  316. name: 'FabricLossTable', // 面料损耗表
  317. mixins: [JeecgListMixin],
  318. components: {
  319. // 面料损耗表 所有弹框
  320. PurchaseAmountModal,
  321. materialsOutQuantityModal,
  322. purchaseInQuantityModal,
  323. invoiceNumModal,
  324. invoiceQuantityModal,
  325. accidentListModal,
  326. surplusYarnModal,
  327. JEllipsis,
  328. moment
  329. },
  330. data() {
  331. return {
  332. fabricLoss: {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[]}, // 主表信息
  333. loading: false, // 表格加载
  334. validatorRules: {
  335. planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
  336. },
  337. // 采购订单 表头
  338. purchaseOrderColumns: [
  339. { title: '货物名称', width: 150, dataIndex: 'cinvName', className: 'replacecolor' },
  340. { title: '批号', width: 80, dataIndex: 'cbatch', className: 'replacecolor' },
  341. { title: '计划数量', dataIndex: 'iquantity', width: 80, className: 'replacecolor' },
  342. {
  343. title: '采购数量',
  344. dataIndex: 'iquantityIn',
  345. width: 80,
  346. className: 'replacecolor',
  347. customCell: this.purchaseQuantityCustomCell,
  348. scopedSlots: { customRender: 'purchaseQuantity' }
  349. },
  350. { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
  351. { title: '分配数量', dataIndex: 'allotQuantity', width: 80, className: 'replacecolor' },
  352. { title: '委外供应商', dataIndex: 'outsourceSupplier', width: 100, className: 'replacecolor' },
  353. {
  354. title: '余纱',
  355. dataIndex: 'surplusYarn',
  356. width: 80,
  357. className: 'replacecolor',
  358. customCell: this.surplusYarnCustomCell,
  359. scopedSlots: { customRender: 'surplusYarn' }
  360. },
  361. { title: '采购损耗', dataIndex: 'purchaseLoss', width: 80, className: 'replacecolor' }
  362. ],
  363. purchaseOrderData: [
  364. {
  365. goodsName: '75D 低弹丝白',
  366. batchNum: '123',
  367. planQuantity: '1350.512',
  368. purchaseQuantity: '1389.1',
  369. purchaseSupplier: '腾依',
  370. allotQuantity: '1389.1',
  371. outsourceSupplier: '飞亚',
  372. surplusYarn: '74859.53',
  373. purchaseLoss: '0%'
  374. },
  375. {
  376. goodsName: '货物2',
  377. batchNum: '234',
  378. planQuantity: '345',
  379. purchaseQuantity: '355',
  380. purchaseSupplier: '供应商2',
  381. allotQuantity: '230',
  382. outsourceSupplier: '委外供应商2',
  383. surplusYarn: '8495.7',
  384. purchaseLoss: '10%'
  385. },
  386. { goodsName: '来源余纱', purchaseQuantity: '2570.4' },
  387. { goodsName: '其他入库的纱', purchaseQuantity: '999' }
  388. ],
  389. // 委外订单国内 表头
  390. outsourceOrderColumns: [
  391. { title: '制造工艺', width: 100, dataIndex: 'cvcname', className: 'replacecolor' },
  392. { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  393. {
  394. title: '材料出库数量',
  395. dataIndex: 'ioutQuantity',
  396. width: 80,
  397. className: 'replacecolor',
  398. customCell: this.materialsOutQuantityCustomCell,
  399. scopedSlots: { customRender: 'materialsOutQuantity' }
  400. },
  401. { title: '委外订单数量', dataIndex: 'iquantity', width: 100, className: 'replacecolor' },
  402. {
  403. title: '单位',
  404. children: [
  405. {
  406. title: '根',
  407. dataIndex: 'unitRoot',
  408. width: 90,
  409. className: 'replacecolor'
  410. },
  411. {
  412. title: '米',
  413. dataIndex: 'unitMeter',
  414. width: 90,
  415. className: 'replacecolor'
  416. }
  417. ]
  418. },
  419. {
  420. title: '采购入库数量',
  421. dataIndex: 'purchaseInQuantity',
  422. width: 80,
  423. className: 'replacecolor',
  424. customCell: this.purchaseInQuantityCustomCell,
  425. scopedSlots: { customRender: 'purchaseInQuantity' }
  426. },
  427. { title: '物料编码', dataIndex: 'cinvCode', width: 100, className: 'replacecolor' },
  428. { title: '货物名称', dataIndex: 'cinvName', width: 150, className: 'replacecolor' },
  429. { title: '颜色', dataIndex: 'color', width: 80, className: 'replacecolor' },
  430. { title: '计划数量', dataIndex: 'planQuantity', width: 80, className: 'replacecolor' },
  431. { title: '损耗', dataIndex: 'loss', wiclassName: 'replacecolor' },
  432. { title: '多发少发', dataIndex: 'moreOrLess', width: 100, className: 'replacecolor' }
  433. ],
  434. outsourceOrderData: [
  435. {
  436. makeWorkmanship: '织造工厂1',
  437. factory: '飞亚',
  438. materialsOutQuantityData: '863',
  439. purchaseAmount: '**',
  440. unitRoot: '77',
  441. unitMeter: '12',
  442. purchaseInQuantity: '848.9',
  443. materialCode: '**',
  444. goodsName: '**',
  445. color: 'red',
  446. planQuantity: '**',
  447. loss: '**',
  448. moreOrLess: '**'
  449. },
  450. {
  451. makeWorkmanship: '织造工厂2',
  452. factory: '的亚',
  453. materialsOutQuantityData: '8263',
  454. purchaseAmount: '**',
  455. companyRoot: '**',
  456. companyMeter: '**',
  457. purchaseInQuantity: '448.9',
  458. materialCode: '**',
  459. goodsName: '**',
  460. color: 'red',
  461. planQuantity: '**',
  462. loss: '**',
  463. moreOrLess: '**'
  464. }
  465. ],
  466. // 委外订单国外 表头
  467. outsourceOrderAbroadColumns: [
  468. { title: '制造工艺', width: 120, dataIndex: 'makeWorkmanship', className: 'replacecolor' },
  469. { title: '工厂', width: 120, dataIndex: 'factory', className: 'replacecolor' },
  470. {
  471. title: '材料出库数量',
  472. dataIndex: 'materialsOutQuantityAbroadData',
  473. width: 120,
  474. className: 'replacecolor',
  475. customCell: this.materialsOutQuantityAbroadCustomCell,
  476. scopedSlots: { customRender: 'materialsOutQuantityAbroad' }
  477. },
  478. { title: '采购数量', dataIndex: 'purchaseAmount', width: 120, className: 'replacecolor' },
  479. {
  480. title: '单位',
  481. children: [
  482. {
  483. title: '根',
  484. dataIndex: 'unitRoot',
  485. width: 90,
  486. className: 'replacecolor'
  487. },
  488. {
  489. title: '米',
  490. dataIndex: 'unitMeter',
  491. width: 90,
  492. className: 'replacecolor'
  493. }
  494. ]
  495. },
  496. {
  497. title: '采购入库数量',
  498. dataIndex: 'purchaseInQuantityAbroad',
  499. width: 120,
  500. className: 'replacecolor',
  501. customCell: this.purchaseInQuantityAbroadCustomCell,
  502. scopedSlots: { customRender: 'purchaseInQuantityAbroad' }
  503. },
  504. { title: '物料编码', dataIndex: 'materialCode', width: 120, className: 'replacecolor' },
  505. { title: '货物名称', dataIndex: 'goodsName', width: 100, className: 'replacecolor' },
  506. { title: '颜色', dataIndex: 'color', width: 120, className: 'replacecolor' },
  507. { title: '计划数量', dataIndex: 'planQuantity', width: 120, className: 'replacecolor' },
  508. { title: '损耗', dataIndex: 'loss', width: 90, className: 'replacecolor' },
  509. { title: '多发少发', dataIndex: 'moreOrLess', width: 100, className: 'replacecolor' }
  510. ],
  511. outsourceOrderAbroadData: [
  512. {
  513. makeWorkmanship: '织造工厂',
  514. factory: '飞亚',
  515. materialsOutQuantityAbroadData: '163',
  516. purchaseAmount: '**',
  517. unitRoot: '88',
  518. unitMeter: '22',
  519. purchaseInQuantityAbroad: '248.9',
  520. materialCode: '**',
  521. goodsName: '**',
  522. color: 'red',
  523. planQuantity: '**',
  524. loss: '**',
  525. moreOrLess: '**'
  526. },
  527. {
  528. makeWorkmanship: '织造工厂3',
  529. factory: '飞亚',
  530. materialsOutQuantityAbroadData: '563',
  531. purchaseAmount: '**',
  532. companyRoot: '**',
  533. companyMeter: '**',
  534. purchaseInQuantityAbroad: '468.9',
  535. materialCode: '**',
  536. goodsName: '**',
  537. color: 'orange',
  538. planQuantity: '**',
  539. loss: '**',
  540. moreOrLess: '**'
  541. }
  542. ],
  543. // 成本发票 表头
  544. costInvoiceColumns: [
  545. { title: '类型', width: 120, dataIndex: 'costInvoiceType', className: 'replacecolor' },
  546. { title: '工厂', width: 120, dataIndex: 'factory', className: 'replacecolor' },
  547. { title: '成本金额', dataIndex: 'costAmount', width: 120, className: 'replacecolor' }
  548. ],
  549. costInvoiceData: [
  550. { costInvoiceType: '纱款', factory: '17TW-C-17B', costAmount: '5081.72' },
  551. { costInvoiceType: '纱款', factory: '17TW-C-17C', costAmount: '127754.31' },
  552. { costInvoiceType: '织款', factory: '18TW-C-8', costAmount: '17045.48' },
  553. { costInvoiceType: '染款', factory: '福隆', costAmount: '59762.4' },
  554. { costInvoiceType: '织款', factory: '江阴美纶', costAmount: '20482.95' }
  555. ],
  556. // 开票成本-面料 表头
  557. costInvoiceFabricColumns: [
  558. {
  559. title: '发票号码',
  560. width: 120,
  561. dataIndex: 'invoiceNum',
  562. className: 'replacecolor',
  563. customCell: this.invoiceNumCustomCell,
  564. scopedSlots: { customRender: 'invoiceNum' }
  565. },
  566. { title: '供应商', width: 120, dataIndex: 'supplier', className: 'replacecolor' },
  567. { title: '采购发票金额', width: 120, dataIndex: 'PurchaseinvoiceCost', className: 'replacecolor' },
  568. { title: '出运日期', width: 120, dataIndex: 'outData', className: 'replacecolor' }
  569. ],
  570. costInvoiceFabricData: [
  571. { invoiceNum: '18TW-MYA-44', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-04' },
  572. { invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
  573. { invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
  574. ],
  575. // 开票成本-成衣 表头
  576. costInvoiceClothesColumns: [
  577. { title: '发票号码', width: 120, dataIndex: 'clInvoiceNum', className: 'replacecolor' },
  578. { title: '委外供应商', width: 120, dataIndex: 'outsourceSupplier', className: 'replacecolor' },
  579. { title: '成衣加工费', width: 120, dataIndex: 'clProcessCost', className: 'replacecolor' },
  580. { title: '出运日期', width: 120, dataIndex: 'outData', className: 'replacecolor' },
  581. { title: '入库数量', width: 120, dataIndex: 'inQuantity', className: 'replacecolor' },
  582. {
  583. title: '发票数量',
  584. dataIndex: 'clInvoiceQuantity',
  585. width: 120,
  586. className: 'replacecolor',
  587. customCell: this.clInvoiceQuantityCustomCell,
  588. scopedSlots: { customRender: 'clInvoiceQuantity' }
  589. }
  590. ],
  591. costInvoiceClothesData: [
  592. {
  593. clInvoiceNum: '18TW-PRU-G30C',
  594. outsourceSupplier: '委外1',
  595. clProcessCost: '19350',
  596. outData: '2018-06-07',
  597. inQuantity: '34',
  598. clInvoiceQuantity: '8000'
  599. },
  600. {
  601. clInvoiceNum: '18TW-PRU-G31',
  602. outsourceSupplier: '委外1',
  603. clProcessCost: '99000',
  604. outData: '2018-03-17',
  605. inQuantity: '34',
  606. clInvoiceQuantity: '8000'
  607. },
  608. {
  609. clInvoiceNum: '18TW-PRU-G32G',
  610. outsourceSupplier: '委外1',
  611. clProcessCost: '34650',
  612. outData: '2018-06-07',
  613. inQuantity: '34',
  614. clInvoiceQuantity: '6000'
  615. }
  616. ],
  617. // 开票成本-辅料 表头
  618. costInvoiceIngredientColumns: [
  619. { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
  620. { title: '订单号', width: 120, dataIndex: 'orderNum', className: 'replacecolor' },
  621. { title: '工厂', width: 120, dataIndex: 'factory', className: 'replacecolor' },
  622. { title: ' 类型', width: 120, dataIndex: 'type', className: 'replacecolor' },
  623. {
  624. title: '发票数量',
  625. width: 120,
  626. dataIndex: 'ingredientsInvoiceQuantity',
  627. className: 'replacecolor',
  628. customCell: this.ingredientsInvoiceQuantityCustomCell,
  629. scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
  630. },
  631. { title: '开票金额(人民币)', width: 120, dataIndex: 'invoiceAmountCNY', className: 'replacecolor' },
  632. { title: '开票金额(美金)', width: 120, dataIndex: 'invoiceAmountUSD', className: 'replacecolor' },
  633. { title: '单位', width: 120, dataIndex: 'unit', className: 'replacecolor' },
  634. { title: '订单数', width: 120, dataIndex: 'orderQuantity', className: 'replacecolor' },
  635. { title: '采购入库数', width: 120, dataIndex: 'purchaseInQuantity', className: 'replacecolor' }
  636. ],
  637. costInvoiceIngredientData: [
  638. { factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
  639. { factory: '森加', type: '尺码标', ingredientsInvoiceQuantity: '3670', invoiceAmountCNY: '1475.6' }
  640. ],
  641. // 费用支出 表头
  642. costPayColumns: [
  643. { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
  644. { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo', className: 'replacecolor' },
  645. { title: '费用项目', dataIndex: 'expenseItem', width: 120, className: 'replacecolor' },
  646. { title: ' 支出本币金额', dataIndex: 'disbursedLocalMoney', width: 120, className: 'replacecolor' },
  647. { title: '支出原币金额', dataIndex: 'disbursedOriginalMoney', width: 120, className: 'replacecolor' },
  648. { title: '发票号', dataIndex: 'invoiceNum', width: 120, className: 'replacecolor' },
  649. { title: '制单人', dataIndex: 'preparedBy', width: 120, className: 'replacecolor' }
  650. ],
  651. costPayData: [{}],
  652. // 事故单 表头
  653. accidentListColumns: [
  654. {
  655. title: '单号',
  656. width: 120,
  657. dataIndex: 'accidentNum',
  658. className: 'replacecolor',
  659. customCell: this.accidentListCustomCell,
  660. scopedSlots: { customRender: 'accidentNum' }
  661. },
  662. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  663. { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
  664. ],
  665. accidentListData: [{ accidentNum: '1100011' }, { accidentNum: '3540011' }],
  666. noteOne: '', // 备注 1
  667. noteTwo: '' // 备注 2
  668. }
  669. },
  670. methods: {
  671. // 【计划单号】 搜索
  672. onSearch(value) {
  673. if (value == "" || value == null){
  674. this.$message.error('请输入计划号!');
  675. }else{
  676. this.loading = true;
  677. this.$nextTick(() => {
  678. getFabricLossDatas({csocode:value}).then(res => {
  679. this.loading = false;
  680. if (res.success) {
  681. this.fabricLoss = res.result;
  682. // console.log('染损列表', this.dyeLossRateData)
  683. }else{
  684. this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[]};
  685. this.$message.error(res.message);
  686. }
  687. })
  688. })
  689. }
  690. },
  691. // 【采购数量】单元格 弹框
  692. purchaseQuantityCustomCell(record) {
  693. return {
  694. on: {
  695. click: event => {
  696. console.log('点击了单元格')
  697. if (this.purchaseOrderColumns.cinvName == '来源余纱') {
  698. console.log('来源余纱this:', this)
  699. console.log('来源余纱event:', event)
  700. this.$refs.fromsurplusYarnModal.fromsurplusYarnModVis = true
  701. }
  702. if (this.purchaseOrderColumns.cinvName == '其他入库的纱') {
  703. console.log('其他入库的纱this:', this)
  704. console.log('其他入库的纱event:', event)
  705. this.$refs.otherYarnsInModal.otherYarnsInModVis = true
  706. } else {
  707. console.log('this:', this)
  708. console.log('event:', event)
  709. this.$refs.purchaseAmountModal.purchaseAmountModVis = true
  710. }
  711. }
  712. }
  713. }
  714. },
  715. // 余纱
  716. surplusYarnCustomCell(record) {
  717. return {
  718. on: {
  719. click: event => {
  720. // console.log('点击了单元格')
  721. console.log('this:', this)
  722. console.log('event:', event)
  723. this.$refs.surplusYarnModal.surplusYarnModVis = true
  724. }
  725. }
  726. }
  727. },
  728. // 【材料出库数量】 弹框
  729. materialsOutQuantityCustomCell(record) {
  730. return {
  731. on: {
  732. click: event => {
  733. console.log('this:', this)
  734. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  735. }
  736. }
  737. }
  738. },
  739. // 采购入库数量
  740. purchaseInQuantityCustomCell(record) {
  741. return {
  742. on: {
  743. click: event => {
  744. console.log('this:', this)
  745. this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
  746. }
  747. }
  748. }
  749. },
  750. // 委外 【材料出库数量】
  751. materialsOutQuantityAbroadCustomCell(record) {
  752. return {
  753. on: {
  754. click: event => {
  755. console.log('this:', this)
  756. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  757. }
  758. }
  759. }
  760. },
  761. // 委外 【采购入库数量】
  762. purchaseInQuantityAbroadCustomCell(record) {
  763. return {
  764. on: {
  765. click: event => {
  766. console.log('this:', this)
  767. this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
  768. }
  769. }
  770. }
  771. },
  772. // 发票号码
  773. invoiceNumCustomCell(record) {
  774. return {
  775. on: {
  776. click: event => {
  777. console.log('this:', this)
  778. this.$refs.invoiceNumModal.invoiceNumModVis = true
  779. }
  780. }
  781. }
  782. },
  783. // 开票成本-面料 ----合计行
  784. fabricFooterShow(data) {
  785. console.log('开票成本-面料 ----合计行')
  786. console.log('data', data)
  787. return (
  788. <a-table
  789. rowKey={Math.random}
  790. bordered={false}
  791. pagination={false}
  792. columns={this.costInvoiceFabricColumns}
  793. dataSource={this.fabricFooterDataSource || []}
  794. showHeader={false}
  795. ></a-table>
  796. )
  797. },
  798. // 开票成本-成衣 ----合计行
  799. clothesFooterShow(data) {
  800. console.log('开票成本-成衣 ----合计行')
  801. console.log('data', data)
  802. return (
  803. <a-table
  804. rowKey={Math.random}
  805. bordered={false}
  806. pagination={false}
  807. columns={this.costInvoiceClothesColumns}
  808. dataSource={this.clothesFooterDataSource || []}
  809. showHeader={false}
  810. ></a-table>
  811. )
  812. },
  813. // 成衣-发票数量
  814. clInvoiceQuantityCustomCell(record) {
  815. return {
  816. on: {
  817. click: event => {
  818. console.log('this:', this)
  819. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
  820. }
  821. }
  822. }
  823. },
  824. // 辅料-发票数量
  825. ingredientsInvoiceQuantityCustomCell(record) {
  826. return {
  827. on: {
  828. click: event => {
  829. console.log('this:', this)
  830. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
  831. }
  832. }
  833. }
  834. },
  835. // 事故单 单号 弹框
  836. accidentListCustomCell(record) {
  837. return {
  838. on: {
  839. click: event => {
  840. console.log('this:', this)
  841. this.$refs.accidentListModal.accidentListModVis = true
  842. }
  843. }
  844. }
  845. },
  846. save() {
  847. console.log('保存,数据保存到哪?')
  848. const that = this
  849. this.$refs.form.validate(valid => {
  850. if (valid) {
  851. // alert('保存!')
  852. console.log('备注信息:', this.fabricLoss.noteOne, '计划单号:', this.fabricLoss.planNum)
  853. // that.$message.success(res.message)
  854. that.$message.success('保存成功,数据添加到成本分配汇总')
  855. } else {
  856. this.$message.info('请选择计划单号、输入备注信息')
  857. }
  858. })
  859. },
  860. // father
  861. aa() {},
  862. bb() {},
  863. cc() {},
  864. dd() {},
  865. ee() {},
  866. ff() {},
  867. gg() {}
  868. },
  869. // 出现滚动条,合计栏跟随 table 滚动
  870. // watch: {
  871. // dataSource(val) {
  872. // console.log(val)
  873. // // 同步表与footer滚动
  874. // let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
  875. // dom.addEventListener(
  876. // 'scroll',
  877. // () => {
  878. // this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
  879. // console.log('走到这')
  880. // },
  881. // true
  882. // )
  883. // }
  884. // },
  885. // 构建合计数据 --合计
  886. computed: {
  887. fabricFooterDataSource() {
  888. // 开票成本-面料 合计
  889. const total = Object.assign({}, this.costInvoiceFabricData[0])
  890. for (const attr in total) {
  891. total[attr] = '合计'
  892. break
  893. }
  894. return [total]
  895. },
  896. clothesFooterDataSource() {
  897. // 开票成本-面料 合计
  898. const total = Object.assign({}, this.costInvoiceClothesData[0])
  899. for (const attr in total) {
  900. total[attr] = '合计'
  901. break
  902. }
  903. return [total]
  904. }
  905. }
  906. }
  907. </script>
  908. <style lang="less" scoped>
  909. @import '~@assets/less/common.less';
  910. @import '~@assets/less/overwriter.less';
  911. /deep/ .ant-table-thead > tr > th {
  912. text-align: center;
  913. // font-weight: 700;
  914. }
  915. /deep/ .ant-table-tbody {
  916. text-align: center;
  917. }
  918. // /deep/ th.replacecolor {
  919. // background-color: #ccc;
  920. // }
  921. /deep/ .ant-table-footer .ant-table.body {
  922. // overflow: hidden !important;
  923. }
  924. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  925. border: none;
  926. padding: 0;
  927. }
  928. </style>