fabric-loss-table.vue 36 KB

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