fabric-loss-table.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  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. customRender:function(text,record,index){
  357. if (text == null || text == undefined){
  358. return "";
  359. }
  360. if (text.indexOf(",")>-1){
  361. const arr = text.split(',');
  362. return (<div>
  363. {
  364. arr.map(t=>{
  365. return (<li>{t}</li>)
  366. })
  367. }
  368. </div>)
  369. }else{
  370. return text;
  371. }
  372. }
  373. },
  374. { title: '计划数量', dataIndex: 'iquantity', width: 80, className: 'replacecolor' },
  375. {
  376. title: '采购数量',
  377. dataIndex: 'iquantityIn',
  378. width: 80,
  379. className: 'replacecolor',
  380. customCell: this.purchaseQuantityCustomCell,
  381. scopedSlots: { customRender: 'purchaseQuantity' }
  382. },
  383. { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
  384. { title: '分配数量', dataIndex: 'iquantityOut', width: 80, className: 'replacecolor' },
  385. { title: '委外供应商', dataIndex: 'omcVenAbbName', width: 100, className: 'replacecolor' },
  386. {
  387. title: '余纱',
  388. dataIndex: 'iquantityLeft',
  389. width: 80,
  390. className: 'replacecolor',
  391. customCell: this.surplusYarnCustomCell,
  392. scopedSlots: { customRender: 'surplusYarn' }
  393. },
  394. { title: '采购损耗', dataIndex: 'iquantityLeftRate', width: 80, className: 'replacecolor' }
  395. ],
  396. // 委外订单国内 表头
  397. outsourceOrderColumns: [
  398. { title: '制造工艺', width: 100, dataIndex: 'cvcname', className: 'replacecolor' },
  399. { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  400. {
  401. title: '材料出库数量',
  402. dataIndex: 'iquantityOut',
  403. width: 120,
  404. className: 'replacecolor',
  405. customCell: this.materialsOutQuantityCustomCell,
  406. scopedSlots: { customRender: 'materialsOutQuantity' }
  407. },
  408. { title: '计划数量', dataIndex: 'iquantity', width: 120, className: 'replacecolor' },
  409. {
  410. title: '单位',
  411. children: [
  412. {
  413. title: '根',
  414. dataIndex: 'iquantityPCS',
  415. width: 120,
  416. className: 'replacecolor'
  417. },
  418. {
  419. title: '米',
  420. dataIndex: 'iquantityM',
  421. width: 120,
  422. className: 'replacecolor'
  423. }
  424. ]
  425. },
  426. {
  427. title: '采购入库数量',
  428. dataIndex: 'iquantityIn',
  429. width: 120,
  430. className: 'replacecolor',
  431. customCell: this.purchaseInQuantityCustomCell,
  432. scopedSlots: { customRender: 'purchaseInQuantity' }
  433. },
  434. { title: '物料编码', dataIndex: 'cinvCode', width: 120, className: 'replacecolor' },
  435. { title: '货物名称', dataIndex: 'cinvName', width: 340, className: 'replacecolor', align:'left' },
  436. { title: '颜色', dataIndex: 'ccolor', width: 120, className: 'replacecolor' },
  437. { title: '损耗', dataIndex: 'cquantityLoss', wiclassName: 'replacecolor' },
  438. { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 120, className: 'replacecolor' }
  439. ],
  440. // 成本发票 表头
  441. costInvoiceColumns: [
  442. { title: '类型', width: 120, dataIndex: 'cvcname', className: 'replacecolor' },
  443. { title: '工厂', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  444. { title: '成本金额', dataIndex: 'imoney', width: 120, className: 'replacecolor' }
  445. ],
  446. costInvoiceData: [
  447. { costInvoiceType: '纱款', factory: '17TW-C-17B', costAmount: '5081.72' },
  448. { costInvoiceType: '纱款', factory: '17TW-C-17C', costAmount: '127754.31' },
  449. { costInvoiceType: '织款', factory: '18TW-C-8', costAmount: '17045.48' },
  450. { costInvoiceType: '染款', factory: '福隆', costAmount: '59762.4' },
  451. { costInvoiceType: '织款', factory: '江阴美纶', costAmount: '20482.95' }
  452. ],
  453. // 开票成本-面料 表头
  454. costInvoiceFabricColumns: [
  455. {
  456. title: '发票号码',
  457. width: 120,
  458. dataIndex: 'csbvcode',
  459. className: 'replacecolor',
  460. customCell: this.invoiceNumCustomCell,
  461. scopedSlots: { customRender: 'invoiceNum' }
  462. },
  463. { title: '供应商', width: 120, dataIndex: 'cvenName', className: 'replacecolor' },
  464. { title: '采购发票金额', width: 120, dataIndex: 'inatSum', className: 'replacecolor' },
  465. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' }
  466. ],
  467. costInvoiceFabricData: [
  468. { invoiceNum: '18TW-MYA-44', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-04' },
  469. { invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
  470. { invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
  471. ],
  472. costInvoiceClothesColumns:[],
  473. // 开票成本-成衣 表头无美元
  474. costInvoiceClothesColumnsM1:[
  475. { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
  476. { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  477. { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  478. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
  479. { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  480. {
  481. title: '发票数量',
  482. dataIndex: 'ipbvquantity',
  483. width: 120,
  484. className: 'replacecolor',
  485. customCell: this.clInvoiceQuantityCustomCell,
  486. scopedSlots: { customRender: 'clInvoiceQuantity' }
  487. }
  488. ],
  489. // 开票成本-成衣 表头
  490. costInvoiceClothesColumnsAll: [
  491. { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
  492. { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  493. { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  494. { title: '成衣加工费(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
  495. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
  496. { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  497. {
  498. title: '发票数量',
  499. dataIndex: 'ipbvquantity',
  500. width: 120,
  501. className: 'replacecolor',
  502. customCell: this.clInvoiceQuantityCustomCell,
  503. scopedSlots: { customRender: 'clInvoiceQuantity' }
  504. }
  505. ],
  506. // 开票成本-辅料 表头
  507. costInvoiceIngredientColumns:[],
  508. costInvoiceIngredientColumnsM1:[
  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: 'ccomUnitName', className: 'replacecolor' },
  523. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  524. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  525. ],
  526. costInvoiceIngredientColumnsAll: [
  527. { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
  528. { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
  529. { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  530. { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
  531. {
  532. title: '发票数量',
  533. width: 120,
  534. dataIndex: 'iquantityInvoice',
  535. className: 'replacecolor',
  536. customCell: this.ingredientsInvoiceQuantityCustomCell,
  537. scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
  538. },
  539. { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  540. { title: '开票金额(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
  541. { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
  542. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  543. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  544. ],
  545. costInvoiceIngredientData: [
  546. { factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
  547. { factory: '森加', type: '尺码标', ingredientsInvoiceQuantity: '3670', invoiceAmountCNY: '1475.6' }
  548. ],
  549. // 费用支出 表头
  550. costPayColumns: [
  551. { title: '账套号', width: 120, dataIndex: 'caccount', className: 'replacecolor' },
  552. { title: '支出单号', width: 120, dataIndex: 'cspvcode', className: 'replacecolor' },
  553. { title: '费用项目', dataIndex: 'cexpName', width: 120, className: 'replacecolor' },
  554. { title: ' 支出本币金额', dataIndex: 'inatMoney', width: 120, className: 'replacecolor' },
  555. { title: '支出原币金额', dataIndex: 'imoney', width: 120, className: 'replacecolor' },
  556. { title: '发票号', dataIndex: 'cinvoinceNo', width: 120, className: 'replacecolor' },
  557. { title: '制单人', dataIndex: 'cmaker', width: 120, className: 'replacecolor' }
  558. ],
  559. costPayData: [{}],
  560. // 事故单 表头
  561. accidentListColumns: [
  562. {
  563. title: '单号',
  564. width: 120,
  565. dataIndex: 'accidentNum',
  566. className: 'replacecolor',
  567. customCell: this.accidentListCustomCell,
  568. scopedSlots: { customRender: 'accidentNum' }
  569. },
  570. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  571. { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
  572. ],
  573. accidentListData: [{ accidentNum: '1100011' }, { accidentNum: '3540011' }],
  574. noteOne: '', // 备注 1
  575. noteTwo: '' // 备注 2
  576. }
  577. },
  578. methods: {
  579. // 【计划单号】 搜索
  580. onSearch(value) {
  581. if (value == "" || value == null){
  582. this.$message.error('请输入计划号!');
  583. }else{
  584. this.loading = true;
  585. this.$nextTick(() => {
  586. getFabricLossDatas({csocode:value}).then(res => {
  587. this.loading = false;
  588. if (res.success) {
  589. // 开票成本成衣:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  590. var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
  591. if (findList.length == 0)
  592. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsM1;
  593. else
  594. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsAll;
  595. // 开票成本辅料:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  596. findList = this.fabricLoss.fabricCostAssistList.filter(e=>e.ioriSum!=e.isum);
  597. if (findList.length == 0)
  598. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsM1;
  599. else
  600. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
  601. this.fabricLoss = res.result;
  602. }else{
  603. this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[]};
  604. this.$message.info(res.message);
  605. }
  606. })
  607. })
  608. }
  609. },
  610. // 【采购数量】单元格 弹框
  611. purchaseQuantityCustomCell(record) {
  612. return {
  613. on: {
  614. click: event => {
  615. if (record.cinvName == '来源余纱') {
  616. this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
  617. this.$refs.surplusYarnModal.surplusYarnModVis = true
  618. }else if (record.cinvName == '其他入库的纱') {
  619. this.$refs.otherYarnsInModal.otherYarnsInData = record.fabricPoOrderOutList;
  620. this.$refs.otherYarnsInModal.otherYarnsInModVis = true
  621. } else {
  622. this.$refs.purchaseAmountModal.purchaseAmountData = record.fabricPoOrderInList;
  623. this.$refs.purchaseAmountModal.purchaseAmountModVis = true
  624. }
  625. }
  626. }
  627. }
  628. },
  629. // 余纱
  630. surplusYarnCustomCell(record) {
  631. return {
  632. on: {
  633. click: event => {
  634. this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
  635. this.$refs.surplusYarnModal.surplusYarnModVis = true
  636. }
  637. }
  638. }
  639. },
  640. // 【材料出库数量】 弹框
  641. materialsOutQuantityCustomCell(record) {
  642. return {
  643. on: {
  644. click: event => {
  645. this.$refs.materialsOutQuantityModal.materialsOutQuantityData = record.fabricMoOrderCKList;
  646. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  647. }
  648. }
  649. }
  650. },
  651. // 采购入库数量
  652. purchaseInQuantityCustomCell(record) {
  653. return {
  654. on: {
  655. click: event => {
  656. this.$refs.purchaseInQuantityModal.purchaseInQuantityData = record.fabricMoOrderRKList;
  657. this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
  658. }
  659. }
  660. }
  661. },
  662. // 开票成本-面料弹框
  663. invoiceNumCustomCell(record) {
  664. return {
  665. on: {
  666. click: event => {
  667. this.$refs.invoiceNumModal.invoiceNumData = record.fabricCostClothDetailList;
  668. this.$refs.invoiceNumModal.invoiceNumModVis = true;
  669. }
  670. }
  671. }
  672. },
  673. // 开票成本-成衣 ----合计行
  674. clothesFooterShow(data) {
  675. return (
  676. <a-table
  677. rowKey={Math.random}
  678. bordered={false}
  679. pagination={false}
  680. columns={this.costInvoiceClothesColumns}
  681. dataSource={this.clothesFooterDataSource || []}
  682. showHeader={false}
  683. ></a-table>
  684. )
  685. },
  686. // 开票成本-辅料 ----合计行
  687. assistFooterShow(data) {
  688. return (
  689. <a-table
  690. rowKey={Math.random}
  691. bordered={false}
  692. pagination={false}
  693. columns={this.costInvoiceIngredientColumns}
  694. dataSource={this.assistFooterDataSource || []}
  695. showHeader={false}
  696. ></a-table>
  697. )
  698. },
  699. // 开票成本-面料 ----合计行
  700. clothFooterShow(data) {
  701. return (
  702. <a-table
  703. rowKey={Math.random}
  704. bordered={false}
  705. pagination={false}
  706. columns={this.costInvoiceFabricColumns}
  707. dataSource={this.clothFooterDataSource || []}
  708. showHeader={false}
  709. ></a-table>
  710. )
  711. },
  712. // 开票成本成衣-弹框
  713. clInvoiceQuantityCustomCell(record) {
  714. return {
  715. on: {
  716. click: event => {
  717. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostClothesDetailList;
  718. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true;
  719. }
  720. }
  721. }
  722. },
  723. // 开票成本辅料-弹框
  724. ingredientsInvoiceQuantityCustomCell(record) {
  725. return {
  726. on: {
  727. click: event => {
  728. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostAssistDetailList;
  729. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
  730. }
  731. }
  732. }
  733. },
  734. // 事故单 单号 弹框
  735. accidentListCustomCell(record) {
  736. return {
  737. on: {
  738. click: event => {
  739. console.log('this:', this)
  740. this.$refs.accidentListModal.accidentListModVis = true
  741. }
  742. }
  743. }
  744. },
  745. save() {
  746. console.log('保存,数据保存到哪?')
  747. const that = this
  748. this.$refs.form.validate(valid => {
  749. if (valid) {
  750. // alert('保存!')
  751. console.log('备注信息:', this.fabricLoss.noteOne, '计划单号:', this.fabricLoss.planNum)
  752. // that.$message.success(res.message)
  753. that.$message.success('保存成功,数据添加到成本分配汇总')
  754. } else {
  755. this.$message.info('请选择计划单号、输入备注信息')
  756. }
  757. })
  758. },
  759. // father
  760. aa() {},
  761. bb() {},
  762. cc() {},
  763. dd() {},
  764. ee() {},
  765. ff() {},
  766. gg() {}
  767. },
  768. // 出现滚动条,合计栏跟随 table 滚动
  769. // watch: {
  770. // dataSource(val) {
  771. // console.log(val)
  772. // // 同步表与footer滚动
  773. // let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
  774. // dom.addEventListener(
  775. // 'scroll',
  776. // () => {
  777. // this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
  778. // console.log('走到这')
  779. // },
  780. // true
  781. // )
  782. // }
  783. // },
  784. // 构建合计数据 --合计
  785. computed: {
  786. clothFooterDataSource() {
  787. // 开票成本-面料 合计
  788. var item = {
  789. "csbvcode":"合计"
  790. };
  791. var inatSum = 0;
  792. for (let row of this.fabricLoss.fabricCostClothList){
  793. inatSum += row.inatSum*1;
  794. }
  795. item.inatSum= parseFloat(inatSum.toFixed(2));
  796. return [item];
  797. },
  798. clothesFooterDataSource() {
  799. // 开票成本-衬衣 合计
  800. var item = {
  801. "cpbvcode":"合计"
  802. };
  803. var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
  804. for (let row of this.fabricLoss.fabricCostClothesList){
  805. isum += row.isum*1;
  806. ioriSum += row.ioriSum*1;
  807. iquantity += row.iquantity*1;
  808. ipbvquantity += row.ipbvquantity*1;
  809. }
  810. item.isum= parseFloat(isum.toFixed(2));
  811. item.ioriSum = parseFloat(ioriSum.toFixed(2));
  812. item.iquantity = parseFloat(iquantity.toFixed(4));
  813. item.ipbvquantity = parseFloat(ipbvquantity.toFixed(4));
  814. return [item];
  815. },
  816. assistFooterDataSource() {
  817. // 开票成本-辅料 合计
  818. var item = {
  819. "caccount":"合计"
  820. };
  821. var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
  822. for (let row of this.fabricLoss.fabricCostAssistList){
  823. isum += row.isum*1;
  824. ioriSum += row.ioriSum*1;
  825. iquantity += row.iquantity*1;
  826. iquantityIn += row.iquantityIn*1;
  827. iquantityInvoice += row.iquantityInvoice*1;
  828. }
  829. item.isum= parseFloat(isum.toFixed(2));
  830. item.ioriSum = parseFloat(ioriSum.toFixed(2));
  831. item.iquantity = parseFloat(iquantity.toFixed(4));
  832. item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
  833. item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
  834. return [item];
  835. }
  836. }
  837. }
  838. </script>
  839. <style lang="less" scoped>
  840. @import '~@assets/less/common.less';
  841. @import '~@assets/less/overwriter.less';
  842. /deep/ .ant-table-thead > tr > th {
  843. text-align: center;
  844. // font-weight: 700;
  845. }
  846. /deep/ .ant-table-tbody {
  847. text-align: center;
  848. }
  849. // /deep/ th.replacecolor {
  850. // background-color: #ccc;
  851. // }
  852. /deep/ .ant-table-footer .ant-table.body {
  853. // overflow: hidden !important;
  854. }
  855. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  856. border: none;
  857. padding: 0;
  858. }
  859. </style>