fabric-loss-table.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  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. <!-- 分配数量 -->
  115. <span slot="slotIquantityOut" slot-scope="text">
  116. <a>{{ text }}</a>
  117. </span>
  118. </a-table>
  119. </div>
  120. <!-- 委外订单国内 -->
  121. <div class="outsource-orders-table" style="margin:40px 0">
  122. <h6 class="table-title">委外订单国内</h6>
  123. <a-table
  124. :row-key="record => record.id"
  125. :columns="outsourceOrderColumns"
  126. :data-source="fabricLoss.fabricOMOrderList1"
  127. bordered
  128. :pagination="false"
  129. :loading="loading">
  130. <!-- 材料出库数量 -->
  131. <span slot="materialsOutQuantity" slot-scope="text">
  132. <a>{{ text }}</a>
  133. </span>
  134. <!-- 采购入库数量 -->
  135. <span slot="purchaseInQuantity" slot-scope="text">
  136. <a>{{ text }}</a>
  137. </span>
  138. </a-table>
  139. </div>
  140. <!-- 委外订单国外 -->
  141. <div class="outsourceOrder-abroad-table">
  142. <h6 class="table-title">委外订单国外</h6>
  143. <a-table
  144. :row-key="record => record.id"
  145. :loading="loading"
  146. :columns="outsourceOrderColumns"
  147. :data-source="fabricLoss.fabricOMOrderList2"
  148. bordered
  149. :pagination="false"
  150. >
  151. <!-- 材料出库数量 -->
  152. <span slot="materialsOutQuantity" slot-scope="text">
  153. <a>{{ text }}</a>
  154. </span>
  155. <!-- 采购入库数量 -->
  156. <span slot="purchaseInQuantity" slot-scope="text">
  157. <a>{{ text }}</a>
  158. </span>
  159. </a-table>
  160. </div>
  161. <!-- 成本发票 -->
  162. <div class="cost-invoice-table" style="margin:40px 0">
  163. <h6 class="table-title">成本发票</h6>
  164. <a-table
  165. :row-key="record => record.id"
  166. :loading="loading"
  167. :columns="costInvoiceColumns"
  168. :data-source="fabricLoss.fabricCostInvoiceList"
  169. bordered
  170. :pagination="false"
  171. >
  172. </a-table>
  173. </div>
  174. <!-- 开票成本-面料 -->
  175. <div class="costInvoice-fabric-table">
  176. <h6 class="table-title">开票成本-面料</h6>
  177. <!-- ref="" -->
  178. <a-table
  179. :row-key="record => record.id"
  180. :loading="loading"
  181. :columns="costInvoiceFabricColumns"
  182. :data-source="fabricLoss.fabricCostClothList"
  183. bordered
  184. :pagination="false"
  185. :footer="clothFooterShow"
  186. >
  187. <!-- 发票号码明细 -->
  188. <span slot="invoiceNum" slot-scope="text">
  189. <a>{{ text }}</a>
  190. </span>
  191. </a-table>
  192. </div>
  193. <!-- 开票成本-成衣 :footer="clothesFooterShow"-->
  194. <div class="costInvoice-clothes-table" style="margin:40px 0">
  195. <h6 class="table-title">开票成本-成衣</h6>
  196. <a-table
  197. :row-key="record => record.id"
  198. :loading="loading"
  199. :columns="costInvoiceClothesColumns"
  200. :data-source="fabricLoss.fabricCostClothesList"
  201. bordered
  202. :pagination="false"
  203. :footer="clothesFooterShow"
  204. >
  205. <!-- 发票数量 -->
  206. <span slot="clInvoiceQuantity" slot-scope="text">
  207. <a>{{ text }}</a>
  208. </span>
  209. </a-table>
  210. </div>
  211. <!-- 开票成本-辅料 -->
  212. <div class="costInvoice-ingredient-table">
  213. <h6 class="table-title">开票成本-辅料</h6>
  214. <a-table
  215. :row-key="record => record.id"
  216. :loading="loading"
  217. :columns="costInvoiceIngredientColumns"
  218. :data-source="fabricLoss.fabricCostAssistList"
  219. bordered
  220. :pagination="false"
  221. :footer="assistFooterShow"
  222. >
  223. <!-- 发票数量 -->
  224. <span slot="ingredientsInvoiceQuantity" slot-scope="text">
  225. <a>{{ text }}</a>
  226. </span>
  227. </a-table>
  228. </div>
  229. <!-- 费用支出 -->
  230. <div class="costPay-table" style="margin:40px 0">
  231. <h6 class="table-title">费用支出</h6>
  232. <a-table
  233. :row-key="record => record.id"
  234. :loading="loading"
  235. :columns="costPayColumns"
  236. :data-source="fabricLoss.fabricExpensesList"
  237. bordered
  238. :pagination="false"
  239. >
  240. </a-table>
  241. </div>
  242. <!-- 事故单 -->
  243. <div class="accidentBill-table">
  244. <h6 class="table-title">事故单</h6>
  245. <a-table
  246. :row-key="record => record.id"
  247. :loading="loading"
  248. :columns="accidentListColumns"
  249. :data-source="fabricLoss.accidentListData"
  250. bordered
  251. :pagination="false"
  252. >
  253. <!-- 事故单 -->
  254. <span slot="accidentNum" slot-scope="text">
  255. <a>{{ text }}</a>
  256. </span>
  257. </a-table>
  258. </div>
  259. <!-- 备注信息 1 根据角色判断 显示备注 1 或备注 2-->
  260. <div class="note-one" style="marginTop:40px;">
  261. <h6 class="table-title">备注信息 1</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 type="textarea" v-model="fabricLoss.noteOne" placeholder="请输入备注" style="minHeight:100px;" />
  266. </a-form-model-item>
  267. </a-form-model>
  268. </div>
  269. </div>
  270. <!-- 备注信息 2 根据角色判断 显示备注 1 或备注 2-->
  271. <!-- <div class="note-one" style="marginTop:40px;">
  272. <h6 class="table-title">备注信息 2</h6>
  273. <div class="noteDetail">
  274. <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
  275. <a-form-model-item prop="noteOne">
  276. <a-input
  277. type="textarea"
  278. v-model="fabricLoss.noteTwo"
  279. placeholder="请输入备注"
  280. style="minHeight:100px;"
  281. />
  282. </a-form-model-item>
  283. </a-form-model>
  284. </div>
  285. </div> -->
  286. <!-- 页面底部保存 -->
  287. <a-row :gutter="24" style="marginTop:40px;float:right">
  288. <a-col :md="12" :sm="12">
  289. <a-button type="primary" @click="save">
  290. 保存
  291. </a-button>
  292. </a-col>
  293. </a-row>
  294. <!-- 弹框 -->
  295. <div>
  296. <!-- 采购数量弹框 @ok="modalFormOk"-->
  297. <purchaseAmount-modal ref="purchaseAmountModal" :father="aa"></purchaseAmount-modal>
  298. <!-- 余纱 -->
  299. <surplusYarn-modal ref="surplusYarnModal" :father="bb"></surplusYarn-modal>
  300. <!-- 其他入库的纱 -->
  301. <otherYarnsIn-modal ref="otherYarnsInModal" :father="hh"></otherYarnsIn-modal>
  302. <!-- 委外订单国内弹框 -->
  303. <materialsOutQuantity-modal ref="materialsOutQuantityModal" :father="cc"></materialsOutQuantity-modal>
  304. <!-- 采购入库数量弹框 -->
  305. <purchaseInQuantity-modal ref="purchaseInQuantityModal" :father="dd"></purchaseInQuantity-modal>
  306. <!-- 发票号码弹框 -->
  307. <invoiceNum-modal ref="invoiceNumModal" :father="ee"></invoiceNum-modal>
  308. <!-- 发票数量弹框 -->
  309. <invoiceQuantity-modal ref="invoiceQuantityModal" :father="ff"></invoiceQuantity-modal>
  310. <!-- 事故单 -->
  311. <accidentList-modal ref="accidentListModal" :father="gg"></accidentList-modal>
  312. </div>
  313. </a-card>
  314. </div>
  315. </template>
  316. <script>
  317. import PurchaseAmountModal from '@views/reportForms/fabric-loss-table/purchaseAmountModal.vue'
  318. import materialsOutQuantityModal from '@views/reportForms/fabric-loss-table/materialsOutQuantityModal.vue'
  319. import purchaseInQuantityModal from '@views/reportForms/fabric-loss-table/purchaseInQuantityModal.vue'
  320. import invoiceNumModal from '@views/reportForms/fabric-loss-table/invoiceNumModal.vue'
  321. import invoiceQuantityModal from '@views/reportForms/fabric-loss-table/invoiceQuantityModal.vue'
  322. import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue'
  323. import surplusYarnModal from '@views/reportForms/fabric-loss-table/surplusYarnModal.vue'
  324. import otherYarnsInModal from '@views/reportForms/fabric-loss-table/otherYarnsInModal.vue'
  325. import { getFabricLossDatas } from '@api/reportForms/fabric-loss-table'
  326. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  327. import JEllipsis from '@/components/jeecg/JEllipsis'
  328. import moment from 'moment'
  329. export default {
  330. name: 'FabricLossTable', // 面料损耗表
  331. mixins: [JeecgListMixin],
  332. components: {
  333. // 面料损耗表 所有弹框
  334. PurchaseAmountModal,
  335. otherYarnsInModal,
  336. materialsOutQuantityModal,
  337. purchaseInQuantityModal,
  338. invoiceNumModal,
  339. invoiceQuantityModal,
  340. accidentListModal,
  341. surplusYarnModal,
  342. JEllipsis,
  343. moment
  344. },
  345. data() {
  346. return {
  347. fabricLoss: {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[]}, // 主表信息
  348. loading: false, // 表格加载
  349. validatorRules: {
  350. planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
  351. },
  352. // 采购订单 表头
  353. purchaseOrderColumns: [
  354. { title: '货物名称', width: 180, dataIndex: 'cinvName', className: 'replacecolor', align:'left'},
  355. { title: '批号', width: 80, dataIndex: 'cbatch', className: 'replacecolor' },
  356. { title: '计划数量', dataIndex: 'iquantity', width: 80, className: 'replacecolor' },
  357. {
  358. title: '采购数量',
  359. dataIndex: 'iquantityIn',
  360. width: 80,
  361. className: 'replacecolor',
  362. customCell: this.purchaseQuantityCustomCell,
  363. scopedSlots: { customRender: 'purchaseQuantity' }
  364. },
  365. { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
  366. { title: '分配数量', dataIndex: 'iquantityOut', width: 80, className: 'replacecolor' },
  367. { title: '委外供应商', dataIndex: 'omcVenAbbName', width: 100, className: 'replacecolor' },
  368. {
  369. title: '余纱',
  370. dataIndex: 'iquantityLeft',
  371. width: 80,
  372. className: 'replacecolor',
  373. customCell: this.surplusYarnCustomCell,
  374. scopedSlots: { customRender: 'surplusYarn' }
  375. },
  376. { title: '采购损耗', dataIndex: 'iquantityLeftRate', width: 80, className: 'replacecolor' }
  377. ],
  378. // 委外订单国内 表头
  379. outsourceOrderColumns: [
  380. { title: '制造工艺', width: 100, dataIndex: 'cvcname', className: 'replacecolor' },
  381. { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  382. {
  383. title: '材料出库数量',
  384. dataIndex: 'iquantityOut',
  385. width: 120,
  386. className: 'replacecolor',
  387. customCell: this.materialsOutQuantityCustomCell,
  388. scopedSlots: { customRender: 'materialsOutQuantity' }
  389. },
  390. { title: '计划数量', dataIndex: 'iquantity', width: 120, className: 'replacecolor' },
  391. {
  392. title: '单位',
  393. children: [
  394. {
  395. title: '根',
  396. dataIndex: 'iquantityPCS',
  397. width: 120,
  398. className: 'replacecolor'
  399. },
  400. {
  401. title: '米',
  402. dataIndex: 'iquantityM',
  403. width: 120,
  404. className: 'replacecolor'
  405. }
  406. ]
  407. },
  408. {
  409. title: '采购入库数量',
  410. dataIndex: 'iquantityIn',
  411. width: 120,
  412. className: 'replacecolor',
  413. customCell: this.purchaseInQuantityCustomCell,
  414. scopedSlots: { customRender: 'purchaseInQuantity' }
  415. },
  416. { title: '物料编码', dataIndex: 'cinvCode', width: 120, className: 'replacecolor' },
  417. { title: '货物名称', dataIndex: 'cinvName', width: 340, className: 'replacecolor', align:'left' },
  418. { title: '颜色', dataIndex: 'ccolor', width: 120, className: 'replacecolor' },
  419. { title: '损耗', dataIndex: 'cquantityLoss', wiclassName: 'replacecolor' },
  420. { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 120, className: 'replacecolor' }
  421. ],
  422. // 成本发票 表头
  423. costInvoiceColumns: [
  424. { title: '类型', width: 120, dataIndex: 'cvcname', className: 'replacecolor' },
  425. { title: '工厂', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  426. { title: '成本金额', dataIndex: 'imoney', width: 120, className: 'replacecolor' }
  427. ],
  428. costInvoiceData: [
  429. { costInvoiceType: '纱款', factory: '17TW-C-17B', costAmount: '5081.72' },
  430. { costInvoiceType: '纱款', factory: '17TW-C-17C', costAmount: '127754.31' },
  431. { costInvoiceType: '织款', factory: '18TW-C-8', costAmount: '17045.48' },
  432. { costInvoiceType: '染款', factory: '福隆', costAmount: '59762.4' },
  433. { costInvoiceType: '织款', factory: '江阴美纶', costAmount: '20482.95' }
  434. ],
  435. // 开票成本-面料 表头
  436. costInvoiceFabricColumns: [
  437. {
  438. title: '发票号码',
  439. width: 120,
  440. dataIndex: 'csbvcode',
  441. className: 'replacecolor',
  442. customCell: this.invoiceNumCustomCell,
  443. scopedSlots: { customRender: 'invoiceNum' }
  444. },
  445. { title: '供应商', width: 120, dataIndex: 'cvenName', className: 'replacecolor' },
  446. { title: '采购发票金额', width: 120, dataIndex: 'inatSum', className: 'replacecolor' },
  447. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' }
  448. ],
  449. costInvoiceFabricData: [
  450. { invoiceNum: '18TW-MYA-44', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-04' },
  451. { invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
  452. { invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
  453. ],
  454. costInvoiceClothesColumns:[],
  455. // 开票成本-成衣 表头无美元
  456. costInvoiceClothesColumnsM1:[
  457. { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
  458. { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  459. { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  460. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
  461. { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  462. {
  463. title: '发票数量',
  464. dataIndex: 'ipbvquantity',
  465. width: 120,
  466. className: 'replacecolor',
  467. customCell: this.clInvoiceQuantityCustomCell,
  468. scopedSlots: { customRender: 'clInvoiceQuantity' }
  469. }
  470. ],
  471. // 开票成本-成衣 表头
  472. costInvoiceClothesColumnsAll: [
  473. { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
  474. { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  475. { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  476. { title: '成衣加工费(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
  477. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
  478. { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  479. {
  480. title: '发票数量',
  481. dataIndex: 'ipbvquantity',
  482. width: 120,
  483. className: 'replacecolor',
  484. customCell: this.clInvoiceQuantityCustomCell,
  485. scopedSlots: { customRender: 'clInvoiceQuantity' }
  486. }
  487. ],
  488. // 开票成本-辅料 表头
  489. costInvoiceIngredientColumns:[],
  490. costInvoiceIngredientColumnsM1:[
  491. { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
  492. { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
  493. { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  494. { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
  495. {
  496. title: '发票数量',
  497. width: 120,
  498. dataIndex: 'iquantityInvoice',
  499. className: 'replacecolor',
  500. customCell: this.ingredientsInvoiceQuantityCustomCell,
  501. scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
  502. },
  503. { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  504. { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
  505. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  506. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  507. ],
  508. costInvoiceIngredientColumnsAll: [
  509. { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
  510. { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
  511. { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  512. { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
  513. {
  514. title: '发票数量',
  515. width: 120,
  516. dataIndex: 'iquantityInvoice',
  517. className: 'replacecolor',
  518. customCell: this.ingredientsInvoiceQuantityCustomCell,
  519. scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
  520. },
  521. { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  522. { title: '开票金额(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
  523. { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
  524. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  525. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  526. ],
  527. costInvoiceIngredientData: [
  528. { factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
  529. { factory: '森加', type: '尺码标', ingredientsInvoiceQuantity: '3670', invoiceAmountCNY: '1475.6' }
  530. ],
  531. // 费用支出 表头
  532. costPayColumns: [
  533. { title: '账套号', width: 120, dataIndex: 'caccount', className: 'replacecolor' },
  534. { title: '支出单号', width: 120, dataIndex: 'cspvcode', className: 'replacecolor' },
  535. { title: '费用项目', dataIndex: 'cexpName', width: 120, className: 'replacecolor' },
  536. { title: ' 支出本币金额', dataIndex: 'inatMoney', width: 120, className: 'replacecolor' },
  537. { title: '支出原币金额', dataIndex: 'imoney', width: 120, className: 'replacecolor' },
  538. { title: '发票号', dataIndex: 'cinvoinceNo', width: 120, className: 'replacecolor' },
  539. { title: '制单人', dataIndex: 'cmaker', width: 120, className: 'replacecolor' }
  540. ],
  541. costPayData: [{}],
  542. // 事故单 表头
  543. accidentListColumns: [
  544. {
  545. title: '单号',
  546. width: 120,
  547. dataIndex: 'accidentNum',
  548. className: 'replacecolor',
  549. customCell: this.accidentListCustomCell,
  550. scopedSlots: { customRender: 'accidentNum' }
  551. },
  552. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  553. { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
  554. ],
  555. accidentListData: [{ accidentNum: '1100011' }, { accidentNum: '3540011' }],
  556. noteOne: '', // 备注 1
  557. noteTwo: '' // 备注 2
  558. }
  559. },
  560. methods: {
  561. // 【计划单号】 搜索
  562. onSearch(value) {
  563. if (value == "" || value == null){
  564. this.$message.error('请输入计划号!');
  565. }else{
  566. this.loading = true;
  567. this.$nextTick(() => {
  568. getFabricLossDatas({csocode:value}).then(res => {
  569. this.loading = false;
  570. if (res.success) {
  571. // 开票成本成衣:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  572. var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
  573. if (findList.length == 0)
  574. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsM1;
  575. else
  576. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsAll;
  577. // 开票成本辅料:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  578. findList = this.fabricLoss.fabricCostAssistList.filter(e=>e.ioriSum!=e.isum);
  579. if (findList.length == 0)
  580. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsM1;
  581. else
  582. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
  583. this.fabricLoss = res.result;
  584. }else{
  585. this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[]};
  586. this.$message.error(res.message);
  587. }
  588. })
  589. })
  590. }
  591. },
  592. // 【采购数量】单元格 弹框
  593. purchaseQuantityCustomCell(record) {
  594. return {
  595. on: {
  596. click: event => {
  597. if (record.cinvName == '来源余纱') {
  598. this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
  599. this.$refs.surplusYarnModal.surplusYarnModVis = true
  600. }else if (record.cinvName == '其他入库的纱') {
  601. this.$refs.otherYarnsInModal.otherYarnsInData = record.fabricPoOrderOutList;
  602. this.$refs.otherYarnsInModal.otherYarnsInModVis = true
  603. } else {
  604. this.$refs.purchaseAmountModal.purchaseAmountData = record.fabricPoOrderInList;
  605. this.$refs.purchaseAmountModal.purchaseAmountModVis = true
  606. }
  607. }
  608. }
  609. }
  610. },
  611. // 余纱
  612. surplusYarnCustomCell(record) {
  613. return {
  614. on: {
  615. click: event => {
  616. this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
  617. this.$refs.surplusYarnModal.surplusYarnModVis = true
  618. }
  619. }
  620. }
  621. },
  622. // 【材料出库数量】 弹框
  623. materialsOutQuantityCustomCell(record) {
  624. return {
  625. on: {
  626. click: event => {
  627. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  628. }
  629. }
  630. }
  631. },
  632. // 采购入库数量
  633. purchaseInQuantityCustomCell(record) {
  634. return {
  635. on: {
  636. click: event => {
  637. this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
  638. }
  639. }
  640. }
  641. },
  642. // 委外 【材料出库数量】
  643. materialsOutQuantityAbroadCustomCell(record) {
  644. return {
  645. on: {
  646. click: event => {
  647. console.log('this:', this)
  648. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  649. }
  650. }
  651. }
  652. },
  653. // 开票成本-面料弹框
  654. invoiceNumCustomCell(record) {
  655. return {
  656. on: {
  657. click: event => {
  658. this.$refs.invoiceNumModal.invoiceNumData = record.fabricCostClothDetailList;
  659. this.$refs.invoiceNumModal.invoiceNumModVis = true;
  660. }
  661. }
  662. }
  663. },
  664. // 开票成本-成衣 ----合计行
  665. clothesFooterShow(data) {
  666. return (
  667. <a-table
  668. rowKey={Math.random}
  669. bordered={false}
  670. pagination={false}
  671. columns={this.costInvoiceClothesColumns}
  672. dataSource={this.clothesFooterDataSource || []}
  673. showHeader={false}
  674. ></a-table>
  675. )
  676. },
  677. // 开票成本-辅料 ----合计行
  678. assistFooterShow(data) {
  679. return (
  680. <a-table
  681. rowKey={Math.random}
  682. bordered={false}
  683. pagination={false}
  684. columns={this.costInvoiceIngredientColumns}
  685. dataSource={this.assistFooterDataSource || []}
  686. showHeader={false}
  687. ></a-table>
  688. )
  689. },
  690. // 开票成本-面料 ----合计行
  691. clothFooterShow(data) {
  692. return (
  693. <a-table
  694. rowKey={Math.random}
  695. bordered={false}
  696. pagination={false}
  697. columns={this.costInvoiceFabricColumns}
  698. dataSource={this.clothFooterDataSource || []}
  699. showHeader={false}
  700. ></a-table>
  701. )
  702. },
  703. // 开票成本成衣-弹框
  704. clInvoiceQuantityCustomCell(record) {
  705. return {
  706. on: {
  707. click: event => {
  708. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostClothesDetailList;
  709. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true;
  710. }
  711. }
  712. }
  713. },
  714. // 开票成本辅料-弹框
  715. ingredientsInvoiceQuantityCustomCell(record) {
  716. return {
  717. on: {
  718. click: event => {
  719. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostAssistDetailList;
  720. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
  721. }
  722. }
  723. }
  724. },
  725. // 事故单 单号 弹框
  726. accidentListCustomCell(record) {
  727. return {
  728. on: {
  729. click: event => {
  730. console.log('this:', this)
  731. this.$refs.accidentListModal.accidentListModVis = true
  732. }
  733. }
  734. }
  735. },
  736. save() {
  737. console.log('保存,数据保存到哪?')
  738. const that = this
  739. this.$refs.form.validate(valid => {
  740. if (valid) {
  741. // alert('保存!')
  742. console.log('备注信息:', this.fabricLoss.noteOne, '计划单号:', this.fabricLoss.planNum)
  743. // that.$message.success(res.message)
  744. that.$message.success('保存成功,数据添加到成本分配汇总')
  745. } else {
  746. this.$message.info('请选择计划单号、输入备注信息')
  747. }
  748. })
  749. },
  750. // father
  751. aa() {},
  752. bb() {},
  753. cc() {},
  754. dd() {},
  755. ee() {},
  756. ff() {},
  757. gg() {}
  758. },
  759. // 出现滚动条,合计栏跟随 table 滚动
  760. // watch: {
  761. // dataSource(val) {
  762. // console.log(val)
  763. // // 同步表与footer滚动
  764. // let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
  765. // dom.addEventListener(
  766. // 'scroll',
  767. // () => {
  768. // this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
  769. // console.log('走到这')
  770. // },
  771. // true
  772. // )
  773. // }
  774. // },
  775. // 构建合计数据 --合计
  776. computed: {
  777. clothFooterDataSource() {
  778. // 开票成本-面料 合计
  779. var item = {
  780. "csbvcode":"合计"
  781. };
  782. var inatSum = 0;
  783. for (let row of this.fabricLoss.fabricCostClothList){
  784. inatSum += row.inatSum*1;
  785. }
  786. item.inatSum= parseFloat(inatSum.toFixed(2));
  787. return [item];
  788. },
  789. clothesFooterDataSource() {
  790. // 开票成本-衬衣 合计
  791. var item = {
  792. "cpbvcode":"合计"
  793. };
  794. var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
  795. for (let row of this.fabricLoss.fabricCostClothesList){
  796. isum += row.isum*1;
  797. ioriSum += row.ioriSum*1;
  798. iquantity += row.iquantity*1;
  799. ipbvquantity += row.ipbvquantity*1;
  800. }
  801. item.isum= parseFloat(isum.toFixed(2));
  802. item.ioriSum = parseFloat(ioriSum.toFixed(2));
  803. item.iquantity = parseFloat(iquantity.toFixed(4));
  804. item.ipbvquantity = parseFloat(ipbvquantity.toFixed(4));
  805. return [item];
  806. },
  807. assistFooterDataSource() {
  808. // 开票成本-辅料 合计
  809. var item = {
  810. "caccount":"合计"
  811. };
  812. var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
  813. for (let row of this.fabricLoss.fabricCostAssistList){
  814. isum += row.isum*1;
  815. ioriSum += row.ioriSum*1;
  816. iquantity += row.iquantity*1;
  817. iquantityIn += row.iquantityIn*1;
  818. iquantityInvoice += row.iquantityInvoice*1;
  819. }
  820. item.isum= parseFloat(isum.toFixed(2));
  821. item.ioriSum = parseFloat(ioriSum.toFixed(2));
  822. item.iquantity = parseFloat(iquantity.toFixed(4));
  823. item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
  824. item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
  825. return [item];
  826. }
  827. }
  828. }
  829. </script>
  830. <style lang="less" scoped>
  831. @import '~@assets/less/common.less';
  832. @import '~@assets/less/overwriter.less';
  833. /deep/ .ant-table-thead > tr > th {
  834. text-align: center;
  835. // font-weight: 700;
  836. }
  837. /deep/ .ant-table-tbody {
  838. text-align: center;
  839. }
  840. // /deep/ th.replacecolor {
  841. // background-color: #ccc;
  842. // }
  843. /deep/ .ant-table-footer .ant-table.body {
  844. // overflow: hidden !important;
  845. }
  846. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  847. border: none;
  848. padding: 0;
  849. }
  850. </style>