fabric-loss-table.vue 34 KB

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