fabric-loss-table.vue 31 KB

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