fabric-loss-table.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. <template>
  2. <!-- 面料损耗表 -->
  3. <div id="fabricLossTable" >
  4. <div >
  5. <!-- 主要信息 点击搜索后 全部回显-->
  6. <a-card title="主要信息" >
  7. <a-row :gutter="24" >
  8. <div class="table-page-search-wrapper" >
  9. <a-form-model layout="inline" ref="form" :model="fabricLoss" :rules="validatorRules" class="kk">
  10. <a-col :md="6" :sm="8">
  11. <a-form-model-item label="计划单号">
  12. <a-input-search
  13. placeholder="请输入计划单号"
  14. v-model="planNO"
  15. enter-button
  16. @search="onSearch($event,'0')"
  17. v-show='showSelect==0'
  18. />
  19. <a-input-search
  20. placeholder="请输入计划单号"
  21. v-text="planNO"
  22. enter-button
  23. @search="onSearch($event,'0')"
  24. v-show='showSelect==1'
  25. />
  26. <a-button type="primary" :disabled="edit == '0'" @click="onSearch(planNO,'1')" class="noprint">更新</a-button>
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :md="6" :sm="8">
  30. <a-form-model-item label="款号" has-feedback>
  31. {{fabricLoss.cdefine22}}
  32. <!-- <a-input v-model="fabricLoss.styleNum"></a-input> -->
  33. </a-form-model-item>
  34. </a-col>
  35. <a-col :md="6" :sm="8">
  36. <a-form-model-item label="计划员">
  37. {{fabricLoss.planner}}
  38. <!-- <a-input v-model="fabricLoss.planner"></a-input> -->
  39. </a-form-model-item>
  40. </a-col>
  41. <a-col :md="6" :sm="8">
  42. <a-form-model-item label="成衣合同号">
  43. {{fabricLoss.contractNo}}
  44. <!-- <a-input v-model="fabricLoss.garmentContractNo"></a-input> -->
  45. </a-form-model-item>
  46. </a-col>
  47. <a-col :md="6" :sm="8">
  48. <a-form-model-item label="排单数量">
  49. {{fabricLoss.number}}
  50. <!-- <a-input v-model="fabricLoss.singleRowNum"></a-input> -->
  51. </a-form-model-item>
  52. </a-col>
  53. <a-col :md="6" :sm="8">
  54. <a-form-model-item label="业务员">
  55. {{fabricLoss.cpersonName}}
  56. <!-- <a-input v-model="fabricLoss.salesman"></a-input> -->
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :md="6" :sm="8">
  60. <a-form-model-item label="总成本">
  61. {{fabricLoss.actualMoney}}
  62. <!-- <a-input v-model="fabricLoss.actualUnitCost"></a-input> -->
  63. </a-form-model-item>
  64. </a-col>
  65. <a-col :md="6" :sm="8">
  66. <a-form-model-item label="实际出库数量">
  67. {{fabricLoss.outboundNumber}}
  68. <!-- <a-input v-model="fabricLoss.actualOutQuantity"></a-input> -->
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :md="6" :sm="8">
  72. <a-form-model-item label="制单人">
  73. {{fabricLoss.makingPeople}}
  74. <!-- <a-input v-model="fabricLoss.preparedBy"></a-input> -->
  75. </a-form-model-item>
  76. </a-col>
  77. <a-col :md="6" :sm="8">
  78. <a-form-model-item label="查询日期">
  79. {{fabricLoss.dateTime}}
  80. <!-- <a-date-picker style="width: 100%" v-model="fabricLoss.queryDate"></a-date-picker> -->
  81. </a-form-model-item>
  82. </a-col>
  83. <a-col :md="6" :sm="8" class="noprint">
  84. <a-button type="primary" @click="openEnclosure">附件</a-button>
  85. </a-col>
  86. </a-form-model>
  87. </div>
  88. </a-row>
  89. </a-card>
  90. </div>
  91. <div >
  92. <!-- 子表 -->
  93. <a-card style="margin:10px 0;">
  94. <!-- 采购订单 -->
  95. <div class="purchase-order-table">
  96. <h6 class="table-title">采购订单</h6>
  97. <a-table
  98. :row-key="record => record.id"
  99. :loading="loading"
  100. :columns="purchaseOrderColumns"
  101. :data-source="fabricLoss.fabricPoOrderList"
  102. bordered
  103. :pagination="false"
  104. >
  105. <template slot="omcVenAbbName" slot-scope="text, record, index">
  106. <div v-for="(item,index) in record.omcVenAbbNameArray" :key="index">
  107. {{item}}
  108. </div>
  109. </template>
  110. <!-- 采购数量 弹框-->
  111. <span slot="purchaseQuantity" slot-scope="text">
  112. <a>{{ text }}</a>
  113. </span>
  114. <!-- 余纱 -->
  115. <span slot="surplusYarn" slot-scope="text">
  116. <a>{{ text }}</a>
  117. </span>
  118. <!-- 来源余纱 -->
  119. <span slot="fromSurplusYarn" slot-scope="text">
  120. <a>{{ text }}</a>
  121. </span>
  122. <!-- 其他入库的纱 -->
  123. <span slot="surplusYarn" slot-scope="text">
  124. <a>{{ text }}</a>
  125. </span>
  126. <!-- 分配数量 -->
  127. <span slot="slotIquantityOut" slot-scope="text">
  128. <a>{{ text }}</a>
  129. </span>
  130. </a-table>
  131. </div>
  132. <!-- 委外订单国内 -->
  133. <div class="outsource-orders-table" style="margin:40px 0" id="mm">
  134. <h6 class="table-title">委外订单国内</h6>
  135. <a-table
  136. id="print1"
  137. ref="form"
  138. :row-key="record => record.id"
  139. :columns="outsourceOrderColumns"
  140. :data-source="fabricLoss.fabricOMOrderList1"
  141. bordered
  142. :pagination="false"
  143. :scroll="{ x: 1500 }"
  144. :loading="loading">
  145. <!-- 材料出库数量 -->
  146. <span slot="materialsOutQuantity" slot-scope="text">
  147. <a>{{ text }}</a>
  148. </span>
  149. <!-- 采购入库数量 -->
  150. <span slot="purchaseInQuantity" slot-scope="text">
  151. <a>{{ text }}</a>
  152. </span>
  153. <!-- 附件 -->
  154. <span slot="enclosure" slot-scope="text, record">
  155. <a-button type="primary" @click="openItemOnclosure(record)" :disabled="record.buttonStatus">附件</a-button>
  156. </span>
  157. </a-table>
  158. </div>
  159. <!-- 委外订单国外 -->
  160. <div class="outsourceOrder-abroad-table" id="cb">
  161. <h6 class="table-title">委外订单国外</h6>
  162. <a-table
  163. :row-key="record => record.id"
  164. :loading="loading"
  165. :columns="outsourceOrderColumns"
  166. :data-source="fabricLoss.fabricOMOrderList2"
  167. :scroll="{ x: 1500 }"
  168. bordered
  169. :pagination="false"
  170. >
  171. <!-- 材料出库数量 -->
  172. <span slot="materialsOutQuantity" slot-scope="text">
  173. <a>{{ text }}</a>
  174. </span>
  175. <!-- 采购入库数量 -->
  176. <span slot="purchaseInQuantity" slot-scope="text">
  177. <a>{{ text }}</a>
  178. </span>
  179. <!-- 附件 -->
  180. <span slot="enclosure" slot-scope="text, record">
  181. <a-button type="primary" @click="openItemOnclosure(record)" :disabled="record.buttonStatus">附件</a-button>
  182. </span>
  183. </a-table>
  184. </div>
  185. <!-- 成本发票 -->
  186. <div class="cost-invoice-table" style="margin:40px 0">
  187. <h6 class="table-title">成本发票</h6>
  188. <a-table
  189. :row-key="record => record.id"
  190. :loading="loading"
  191. :columns="costInvoiceColumns"
  192. :data-source="fabricLoss.fabricCostInvoiceList"
  193. bordered
  194. :pagination="false"
  195. >
  196. </a-table>
  197. </div>
  198. <!-- 开票成本-面料 -->
  199. <div class="costInvoice-fabric-table">
  200. <h6 class="table-title">开票成本-面料</h6>
  201. <!-- ref="" -->
  202. <a-table
  203. :row-key="record => record.id"
  204. :loading="loading"
  205. :columns="costInvoiceFabricColumns"
  206. :data-source="fabricLoss.fabricCostClothList"
  207. bordered
  208. :pagination="false"
  209. >
  210. <!-- 发票号码明细 -->
  211. <span slot="invoiceNum" slot-scope="text">
  212. <a v-if="text!=='合计'">{{ text }}</a>
  213. <span v-else>{{text}}</span>
  214. </span>
  215. </a-table>
  216. </div>
  217. <!-- 开票成本-成衣 :footer="clothesFooterShow"-->
  218. <div class="costInvoice-clothes-table" style="margin:40px 0">
  219. <h6 class="table-title">开票成本-成衣</h6>
  220. <a-table
  221. :row-key="record => record.id"
  222. :loading="loading"
  223. :columns="costInvoiceClothesColumns"
  224. :data-source="fabricLoss.fabricCostClothesList"
  225. bordered
  226. :pagination="false"
  227. >
  228. <!-- 发票数量 -->
  229. <span slot="clInvoiceQuantity" slot-scope="text">
  230. <a>{{ text }}</a>
  231. </span>
  232. </a-table>
  233. </div>
  234. <!-- 开票成本-辅料 -->
  235. <div class="costInvoice-ingredient-table">
  236. <h6 class="table-title">开票成本-辅料</h6>
  237. <a-table
  238. :row-key="record => record.id"
  239. :loading="loading"
  240. :columns="costInvoiceIngredientColumns"
  241. :data-source="fabricLoss.fabricCostAssistList"
  242. bordered
  243. :pagination="false"
  244. >
  245. <!-- 发票数量 -->
  246. <span slot="ingredientsInvoiceQuantity" slot-scope="text">
  247. <a>{{ text }}</a>
  248. </span>
  249. </a-table>
  250. </div>
  251. <!-- 费用支出 -->
  252. <div class="costPay-table noprint" style="margin:40px 0">
  253. <h6 class="table-title">费用支出</h6>
  254. <a-table
  255. :row-key="record => record.id"
  256. :loading="loading"
  257. :columns="costPayColumns"
  258. :data-source="fabricLoss.fabricExpensesList"
  259. bordered
  260. :pagination="false"
  261. :footer="costPayFooterShow"
  262. >
  263. </a-table>
  264. </div>
  265. <!-- 事故单 -->
  266. <div class="accidentBill-table">
  267. <h6 class="table-title">事故单</h6>
  268. <a-table
  269. :row-key="record => record.id"
  270. :loading="loading"
  271. :columns="accidentListColumns"
  272. :data-source="fabricLoss.fabricAccidentList"
  273. bordered
  274. :pagination="false"
  275. >
  276. <!-- 事故单 -->
  277. <span slot="accidentNum" slot-scope="text">
  278. <a>{{ text }}</a>
  279. </span>
  280. </a-table>
  281. </div>
  282. <!-- 备注信息 1 根据角色判断 显示备注 1 或备注 2-->
  283. <div class="note-one" style="marginTop:40px;">
  284. <h6 class="table-title">备注</h6>
  285. <div class="noteDetail">
  286. <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
  287. <a-form-model-item prop="noteOne">
  288. <a-input type="textarea" v-model="fabricLoss.noteOne" style="minHeight:100px;" v-show='showSelect==0'/>
  289. <a-input type="textarea" v-text="fabricLoss.noteOne" style="minHeight:100px;" v-show='showSelect==1'/>
  290. </a-form-model-item>
  291. </a-form-model>
  292. </div>
  293. </div>
  294. <!-- 采购订单 -->
  295. <!-- 备注信息 2 根据角色判断 显示备注 1 或备注 2-->
  296. <!-- <div class="note-one" style="marginTop:40px;">
  297. <h6 class="table-title">备注信息 2</h6>
  298. <div class="noteDetail">
  299. <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
  300. <a-form-model-item prop="noteOne">
  301. <a-input
  302. type="textarea"
  303. v-model="fabricLoss.noteTwo"
  304. placeholder="请输入备注"
  305. style="minHeight:100px;"
  306. />
  307. </a-form-model-item>
  308. </a-form-model>
  309. </div>
  310. </div> -->
  311. <!-- 页面底部保存 -->
  312. <a-row :gutter="24" style="marginTop:40px;float:right" class="noprint">
  313. <a-col :md="12" :sm="12" style="display:flex">
  314. <a-button type="primary" @click="daYin" style="margin-right:6px" :disabled ="PrintButton">
  315. 打印
  316. </a-button>
  317. <a-button type="primary" @click="save">
  318. 保存
  319. </a-button>
  320. </a-col>
  321. </a-row>
  322. <!-- 弹框 -->
  323. <div>
  324. <!-- 采购数量弹框 @ok="modalFormOk"-->
  325. <purchaseAmount-modal ref="purchaseAmountModal" :father="aa"></purchaseAmount-modal>
  326. <!-- 来源余纱 -->
  327. <surplusYarn-modal ref="surplusYarnModal" :father="bb"></surplusYarn-modal>
  328. <!-- 余纱 -->
  329. <purchaseLeft-modal ref="purchaseLeftModal"></purchaseLeft-modal>
  330. <!-- 其他入库的纱 -->
  331. <otherYarnsIn-modal ref="otherYarnsInModal" ></otherYarnsIn-modal>
  332. <!-- 委外订单国内弹框 -->
  333. <materialsOutQuantity-modal ref="materialsOutQuantityModal" :father="cc"></materialsOutQuantity-modal>
  334. <!-- 采购入库数量弹框 -->
  335. <purchaseInQuantity-modal ref="purchaseInQuantityModal" :father="dd"></purchaseInQuantity-modal>
  336. <!-- 发票号码弹框 -->
  337. <invoiceNum-modal ref="invoiceNumModal" :father="ee"></invoiceNum-modal>
  338. <!-- 发票数量弹框 -->
  339. <invoiceQuantity-modal ref="invoiceQuantityModal" :father="ff"></invoiceQuantity-modal>
  340. <!-- 事故单 -->
  341. <accidentList-modal ref="accidentListModal" :father="gg"></accidentList-modal>
  342. <!-- 附件 -->
  343. <attachment-display ref="attachmentDisplay"></attachment-display>
  344. </div>
  345. </a-card>
  346. </div>
  347. </div>
  348. </template>
  349. <script>
  350. import PurchaseAmountModal from '@views/reportForms/fabric-loss-table/purchaseAmountModal.vue'
  351. import materialsOutQuantityModal from '@views/reportForms/fabric-loss-table/materialsOutQuantityModal.vue'
  352. import purchaseInQuantityModal from '@views/reportForms/fabric-loss-table/purchaseInQuantityModal.vue'
  353. import invoiceNumModal from '@views/reportForms/fabric-loss-table/invoiceNumModal.vue'
  354. import invoiceQuantityModal from '@views/reportForms/fabric-loss-table/invoiceQuantityModal.vue'
  355. import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue'
  356. import surplusYarnModal from '@views/reportForms/fabric-loss-table/surplusYarnModal.vue'
  357. import purchaseLeftModal from '@views/reportForms/fabric-loss-table/purchaseLeftModal.vue'
  358. import otherYarnsInModal from '@views/reportForms/fabric-loss-table/otherYarnsInModal.vue'
  359. import AttachmentDisplay from '@views/reportForms/fabric-loss-table/attachment-display.vue'
  360. import { getFabricLossDatas,saveFabricLossData } from '@api/reportForms/fabric-loss-table'
  361. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  362. import JEllipsis from '@/components/jeecg/JEllipsis'
  363. import moment from 'moment'
  364. export default {
  365. name: 'FabricLossTable', // 面料损耗表
  366. mixins: [JeecgListMixin],
  367. components: {
  368. // 面料损耗表 所有弹框
  369. PurchaseAmountModal,
  370. otherYarnsInModal,
  371. materialsOutQuantityModal,
  372. purchaseInQuantityModal,
  373. invoiceNumModal,
  374. invoiceQuantityModal,
  375. accidentListModal,
  376. surplusYarnModal,
  377. purchaseLeftModal,
  378. JEllipsis,
  379. moment,
  380. AttachmentDisplay
  381. },
  382. data() {
  383. return {
  384. PrintButton:true,//打印按钮
  385. showSelect:0,//计划号是否是输入框
  386. fabricLoss: {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]}, // 主表信息
  387. loading: false, // 表格加载
  388. validatorRules: {
  389. planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
  390. },
  391. edit:'0',
  392. planNO:'',//计划单号
  393. // 采购订单 表头
  394. purchaseOrderColumns: [
  395. { title: '货物名称', width: 180, dataIndex: 'cinvName', className: 'replacecolor', align:'left'},
  396. /*
  397. { title: '批号', width: 80, dataIndex: 'cbatch', className: 'replacecolor',
  398. customRender:function(text,record,index){
  399. if (text == null || text == undefined){
  400. return "";
  401. }
  402. if (text.indexOf(",")>-1){
  403. const arr = text.split(',');
  404. return (<div>
  405. {
  406. arr.map(t=>{
  407. return (<li>{t}</li>)
  408. })
  409. }
  410. </div>)
  411. }else{
  412. return text;
  413. }
  414. }
  415. },*/
  416. { title: '订单号', width: 80, dataIndex: 'cpoid', className: 'replacecolor',
  417. customRender:function(text,record,index){
  418. if (text == null || text == undefined){
  419. return "";
  420. }
  421. if (text.indexOf(",")>-1){
  422. const arr = text.split(',');
  423. return (<div>
  424. {
  425. arr.map(t=>{
  426. return (<li>{t}</li>)
  427. })
  428. }
  429. </div>)
  430. }else{
  431. return text;
  432. }
  433. }
  434. },
  435. { title: '计划数量', dataIndex: 'iquantity', width: 80, className: 'replacecolor' },
  436. {
  437. title: '采购数量',
  438. dataIndex: 'iquantityIn',
  439. width: 80,
  440. className: 'replacecolor',
  441. customCell: this.purchaseQuantityCustomCell,
  442. scopedSlots: { customRender: 'purchaseQuantity' }
  443. },
  444. { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
  445. { title: '分配数量', dataIndex: 'iquantityOut', width: 80, className: 'replacecolor' },
  446. { title: '委外供应商', dataIndex: 'omcVenAbbName', width: 100, className: 'replacecolor',scopedSlots: { customRender: 'omcVenAbbName' }, },
  447. {
  448. title: '余纱',
  449. dataIndex: 'iquantityLeft',
  450. width: 80,
  451. className: 'replacecolor',
  452. customCell: this.surplusYarnCustomCell,
  453. scopedSlots: { customRender: 'surplusYarn' }
  454. },
  455. { title: '采购损耗', dataIndex: 'iquantityLeftRate', width: 80, className: 'replacecolor' }
  456. ],
  457. // 委外订单国内 表头
  458. outsourceOrderColumns: [
  459. { title: '制造工艺', width: 100, dataIndex: 'cvcname', className: 'replacecolor' },
  460. { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  461. {
  462. title: '材料出库数量',
  463. dataIndex: 'iquantityOut',
  464. width: 100,
  465. className: 'replacecolor',
  466. customCell: this.materialsOutQuantityCustomCell,
  467. scopedSlots: { customRender: 'materialsOutQuantity' }
  468. },
  469. { title: '计划数量', dataIndex: 'iquantity', width: 100, className: 'replacecolor' },
  470. {
  471. title: '单位',
  472. children: [
  473. {
  474. title: '根',
  475. dataIndex: 'iquantityPCS',
  476. width: 100,
  477. className: 'replacecolor'
  478. },
  479. {
  480. title: '米',
  481. dataIndex: 'iquantityM',
  482. width: 100,
  483. className: 'replacecolor'
  484. }
  485. ]
  486. },
  487. {
  488. title: '采购入库数量',
  489. dataIndex: 'iquantityIn',
  490. width: 100,
  491. className: 'replacecolor',
  492. customCell: this.purchaseInQuantityCustomCell,
  493. scopedSlots: { customRender: 'purchaseInQuantity' }
  494. },
  495. { title: '染厂色号', dataIndex: 'ccolorNumber', width: 120, className: 'replacecolor' },
  496. { title: '物料编码', dataIndex: 'cinvCode', width: 120, className: 'replacecolor' },
  497. { title: '货物名称', dataIndex: 'cinvName', width: 200, className: 'replacecolor', align:'left' },
  498. { title: '颜色', dataIndex: 'ccolor', width: 110, className: 'replacecolor' },
  499. { title: '损耗', dataIndex: 'cquantityLoss', width: 100,className: 'replacecolor' },
  500. { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 100, className: 'replacecolor' },
  501. { title: '附件', dataIndex: 'enclosure', width: 100, className: 'noprint', scopedSlots: { customRender: 'enclosure' }}
  502. ],
  503. // 成本发票 表头
  504. costInvoiceColumns: [
  505. { title: '类型', width: 120, dataIndex: 'cvcname', className: 'replacecolor' },
  506. { title: '采购类型', width: 120, dataIndex: 'cbusType', className: 'replacecolor' },
  507. { title: '工厂', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  508. { title: '成本金额', dataIndex: 'imoney', width: 120, className: 'replacecolor' }
  509. ],
  510. costInvoiceData: [
  511. { costInvoiceType: '纱款', factory: '17TW-C-17B', costAmount: '5081.72' },
  512. { costInvoiceType: '纱款', factory: '17TW-C-17C', costAmount: '127754.31' },
  513. { costInvoiceType: '织款', factory: '18TW-C-8', costAmount: '17045.48' },
  514. { costInvoiceType: '染款', factory: '福隆', costAmount: '59762.4' },
  515. { costInvoiceType: '织款', factory: '江阴美纶', costAmount: '20482.95' }
  516. ],
  517. // 开票成本-面料 表头
  518. costInvoiceFabricColumns: [
  519. { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
  520. {
  521. title: '发票号码',
  522. width: 120,
  523. dataIndex: 'csbvcode',
  524. className: 'replacecolor',
  525. customCell: this.invoiceNumCustomCell,
  526. scopedSlots: { customRender: 'invoiceNum' }
  527. },
  528. { title: '供应商', width: 120, dataIndex: 'cvenName', className: 'replacecolor' },
  529. { title: '采购发票金额', width: 120, dataIndex: 'inatSum', className: 'replacecolor' },
  530. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' }
  531. ],
  532. costInvoiceFabricData: [
  533. { invoiceNum: '18TW-MYA-44', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-04' },
  534. { invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
  535. { invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
  536. ],
  537. costInvoiceClothesColumns:[],
  538. // 开票成本-成衣 表头无美元
  539. costInvoiceClothesColumnsM1:[
  540. { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
  541. { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
  542. { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  543. { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  544. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
  545. { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  546. {
  547. title: '发票数量',
  548. dataIndex: 'ipbvquantity',
  549. width: 120,
  550. className: 'replacecolor',
  551. customCell: this.clInvoiceQuantityCustomCell,
  552. scopedSlots: { customRender: 'clInvoiceQuantity' }
  553. }
  554. ],
  555. // 开票成本-成衣 表头
  556. costInvoiceClothesColumnsAll: [
  557. { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
  558. { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
  559. { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  560. { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  561. { title: '成衣加工费(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
  562. { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
  563. { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  564. {
  565. title: '发票数量',
  566. dataIndex: 'ipbvquantity',
  567. width: 120,
  568. className: 'replacecolor',
  569. customCell: this.clInvoiceQuantityCustomCell,
  570. scopedSlots: { customRender: 'clInvoiceQuantity' }
  571. }
  572. ],
  573. // 开票成本-辅料 表头
  574. costInvoiceIngredientColumns:[],
  575. costInvoiceIngredientColumnsM1:[
  576. { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
  577. { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
  578. { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
  579. { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  580. { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
  581. {
  582. title: '发票数量',
  583. width: 120,
  584. dataIndex: 'iquantityInvoice',
  585. className: 'replacecolor',
  586. customCell: this.ingredientsInvoiceQuantityCustomCell,
  587. scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
  588. },
  589. { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  590. { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
  591. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  592. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  593. ],
  594. costInvoiceIngredientColumnsAll: [
  595. { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
  596. { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
  597. { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  598. { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
  599. {
  600. title: '发票数量',
  601. width: 120,
  602. dataIndex: 'iquantityInvoice',
  603. className: 'replacecolor',
  604. customCell: this.ingredientsInvoiceQuantityCustomCell,
  605. scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
  606. },
  607. { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
  608. { title: '开票金额(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
  609. { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
  610. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  611. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  612. ],
  613. costInvoiceIngredientData: [
  614. { factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
  615. { factory: '森加', type: '尺码标', ingredientsInvoiceQuantity: '3670', invoiceAmountCNY: '1475.6' }
  616. ],
  617. // 费用支出 表头
  618. costPayColumns: [
  619. { title: '账套号', width: 120, dataIndex: 'caccount', className: 'replacecolor' },
  620. { title: '支出单号', width: 120, dataIndex: 'cspvcode', className: 'replacecolor' },
  621. { title: '费用项目', dataIndex: 'cexpName', width: 120, className: 'replacecolor' },
  622. { title: '支出人民币金额', dataIndex: 'inatMoney', width: 120, className: 'replacecolor' },
  623. { title: '支出美元金额', dataIndex: 'imoney', width: 120, className: 'replacecolor',customRender: (text, record, index) => {
  624. if (record.imoney == record.inatMoney)
  625. return "";
  626. else
  627. return record.imoney;
  628. } },
  629. { title: '发票号', dataIndex: 'cinvoinceNo', width: 120, className: 'replacecolor' },
  630. { title: '制单人', dataIndex: 'cmaker', width: 120, className: 'replacecolor' }
  631. ],
  632. costPayData: [{}],
  633. // 事故单 表头
  634. accidentListColumns: [
  635. {
  636. title: '单号',
  637. width: 120,
  638. dataIndex: 'cpbvcode',
  639. className: 'replacecolor',
  640. customCell: this.accidentListCustomCell,
  641. scopedSlots: { customRender: 'cpbvcode' }
  642. },
  643. { title: '事故承担方', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  644. { title: '金额', dataIndex: 'ioriSum', width: 120, className: 'replacecolor' }
  645. ],
  646. accidentListData: [{ accidentNum: '1100011' }, { accidentNum: '3540011' }],
  647. noteOne: '', // 备注 1
  648. noteTwo: '' // 备注 2
  649. }
  650. },
  651. methods: {
  652. daYin(){
  653. // printJS({
  654. // printable:this.fabricLoss.fabricOMOrderList1,
  655. // properties:[
  656. // {field:'cvcname',displayName:'制造工艺',columnSize:1},
  657. // {field:'cvenAbbName',displayName:'工厂',columnSize:1},
  658. // {field:'iquantityOut',displayName:'材料出库数量',columnSize:1},
  659. // {field:'iquantity', displayName:'计划数量',columnSize:1},
  660. // {field:'iquantityIn', displayName:'采购入库数量',columnSize:1},
  661. // {field:'cinvCode', displayName:'物料编码',columnSize:1},
  662. // {field:'cinvName', displayName:'货物名称',columnSize:1},
  663. // {field:'ccolor', displayName:'颜色',columnSize:1},
  664. // {field:'cquantityLoss', displayName:'损耗',columnSize:1},
  665. // {field:'iquantityMoreLess', displayName:'多发少发',columnSize:1},
  666. // ],
  667. // type:'json',
  668. // header:'C001',
  669. //样式设置
  670. // gridStyle:'border:2px solid #3971A5;text-align: center',
  671. // gridHeaderStyle:'color:red; border:2px solid #3971A5;'
  672. // })
  673. this.showSelect = 1
  674. this.$nextTick(() => {
  675. const html = window.document.getElementById('fabricLossTable').innerHTML
  676. const win = window.open();
  677. const style = '<style>\n'
  678. +'.noprint{display:none}'
  679. +'.ant-table-body{overflow-x: hidden !important }' //去除滚动条
  680. +'.kk{display:flex;flex-wrap: wrap}' //主要信息并排
  681. +'.ant-col-sm-8{width:40%;margin-bottom: 6px;}'
  682. +'.ant-form-item-label{width:45%;font-size: 12px;}'
  683. +'.ant-form-item-children{font-size: 12px}'
  684. +'.ant-card-head-title{font-weight: bold;font-size: 0.67em;margin-bottom: 9px;}'
  685. +'.ant-form-item-control-wrapper{width:100%}'
  686. +'.ant-input{width:100%}'
  687. +'.ant-form-item{display:flex}'
  688. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  689. + 'th,td{width:5%;height: 18px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px;text-align: center;}\n'
  690. +'.ant-table-row-cell-break-word{width:5% !important}'
  691. + 'th{color: #333}\n'
  692. + 'a{color: #666; text-decoration:none;}\n'
  693. + '</style>';
  694. win.document.write(style+html);
  695. win.focus();
  696. win.print();
  697. win.close();
  698. this.showSelect = 0
  699. })
  700. },
  701. // 【计划单号】 搜索
  702. onSearch(value,update) {
  703. if (value == "" || value == null){
  704. this.$message.error('请输入计划号!');
  705. }else{
  706. this.loading = true;
  707. this.$nextTick(() => {
  708. getFabricLossDatas({csocode:value,update:update}).then(res => {
  709. this.loading = false;
  710. if (res.success) {
  711. this.PrintButton = false
  712. // 开票成本成衣:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  713. var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
  714. if (findList.length == 0)
  715. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsM1;
  716. else
  717. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsAll;
  718. // 开票成本辅料:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  719. findList = this.fabricLoss.fabricCostAssistList.filter(e=>e.ioriSum!=e.isum);
  720. if (findList.length == 0)
  721. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsM1;
  722. else
  723. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
  724. this.fabricLoss = res.result;
  725. this.edit = this.fabricLoss.edit
  726. // 委外订单国内附件按钮状态
  727. this.fabricLoss.fabricOMOrderList1.map(item=>{
  728. item.buttonStatus = false
  729. if(!item.accessorItemList||item.accessorItemList.length == 0 ){
  730. item.buttonStatus = true
  731. }
  732. })
  733. // 委外订单国外附件按钮状态
  734. this.fabricLoss.fabricOMOrderList2.map(item=>{
  735. item.buttonStatus = false
  736. if(!item.accessorItemList||item.accessorItemList.length == 0 ){
  737. item.buttonStatus = true
  738. }
  739. })
  740. this.fabricLoss.fabricCostClothesList.map((item,index) => {item.index = index +1})
  741. this.fabricLoss.fabricCostClothList.map((item,index) => {item.index = index +1})
  742. this.fabricLoss.fabricCostAssistList.map((item,index) => {item.index = index +1})
  743. this.fabricLoss.fabricPoOrderList.map(item => {
  744. item["omcVenAbbNameArray"] = item.omcVenAbbName ? (item.omcVenAbbName.split(",")) : ''
  745. })
  746. if (this.fabricLoss.fabricAccidentList == null){
  747. this.fabricLoss.fabricAccidentList = [];
  748. }
  749. this.calculateTotal()
  750. }else{
  751. this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]};
  752. this.$message.info(res.message);
  753. }
  754. this.judgeListLength()
  755. })
  756. })
  757. }
  758. },
  759. //计算合计行
  760. calculateTotal(){
  761. //计算成本发票合计
  762. var imoney = 0;
  763. for (let row of this.fabricLoss.fabricCostInvoiceList){
  764. imoney += row.imoney*1;
  765. }
  766. if(this.fabricLoss.fabricCostInvoiceList.length !==0){
  767. this.fabricLoss.fabricCostInvoiceList.push({
  768. cvcname:'',
  769. cbusType:'合计',
  770. cvenAbbName:'',
  771. imoney:parseFloat(imoney.toFixed(2))
  772. })
  773. }
  774. //计算开票成本-面料合计
  775. var inatSum = 0;
  776. for (let row of this.fabricLoss.fabricCostClothList){
  777. inatSum += row.inatSum*1;
  778. }
  779. if(this.fabricLoss.fabricCostClothList.length !==0){
  780. this.fabricLoss.fabricCostClothList.push({
  781. index:'',
  782. csbvcode:'合计',
  783. cvenName:'',
  784. inatSum:parseFloat(inatSum.toFixed(2)),
  785. cshipTime:''
  786. })
  787. }
  788. //计算开票成本-成衣合计
  789. var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
  790. for (let row of this.fabricLoss.fabricCostClothesList){
  791. isum += row.isum*1;
  792. ioriSum += row.ioriSum*1;
  793. iquantity += row.iquantity*1;
  794. ipbvquantity += row.ipbvquantity*1;
  795. }
  796. if(this.fabricLoss.fabricCostClothesList.length!==0){
  797. this.fabricLoss.fabricCostClothesList.push({
  798. cpbvcode:'合计',
  799. isum: parseFloat(isum.toFixed(2)),
  800. ioriSum: parseFloat(ioriSum.toFixed(2)),
  801. iquantity: parseFloat(iquantity.toFixed(4)),
  802. ipbvquantity: parseFloat(ipbvquantity.toFixed(4)),
  803. })
  804. }
  805. //开票成本-辅料合计
  806. var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
  807. for (let row of this.fabricLoss.fabricCostAssistList){
  808. isum += row.isum*1;
  809. ioriSum += row.ioriSum*1;
  810. iquantity += row.iquantity*1;
  811. iquantityIn += row.iquantityIn*1;
  812. iquantityInvoice += row.iquantityInvoice*1;
  813. }
  814. if(this.fabricLoss.fabricCostAssistList.length !== 0){
  815. this.fabricLoss.fabricCostAssistList.push({
  816. caccount:'合计',
  817. isum:parseFloat(isum.toFixed(2)),
  818. ioriSum:parseFloat(ioriSum.toFixed(2)),
  819. iquantity:parseFloat(iquantity.toFixed(4)),
  820. iquantityIn:parseFloat(iquantityIn.toFixed(4)),
  821. iquantityInvoice:parseFloat(iquantityInvoice.toFixed(4))
  822. })
  823. }
  824. //事故单合计
  825. var item = {
  826. "cvenAbbName":"合计"
  827. };
  828. var ioriSum = 0
  829. for (let row of this.fabricLoss.fabricAccidentList){
  830. ioriSum += row.ioriSum*1
  831. }
  832. if(this.fabricLoss.fabricAccidentList.length !== 0){
  833. this.fabricLoss.fabricAccidentList.push({
  834. cvenAbbName:"合计",
  835. ioriSum:parseFloat(ioriSum.toFixed(4))
  836. })
  837. }
  838. },
  839. //判断哪个列表为空
  840. judgeListLength(){
  841. var data = [
  842. {List:this.fabricLoss.fabricPoOrderList,class:'.purchase-order-table'},
  843. {List:this.fabricLoss.fabricOMOrderList1,class:'.outsource-orders-table'},
  844. {List:this.fabricLoss.fabricOMOrderList2,class:'.outsourceOrder-abroad-table'},
  845. {List:this.fabricLoss.fabricCostInvoiceList,class:'.cost-invoice-table'},
  846. {List:this.fabricLoss.fabricCostClothList,class:'.costInvoice-fabric-table'},
  847. {List:this.fabricLoss.fabricCostClothesList,class:'.costInvoice-clothes-table'},
  848. {List:this.fabricLoss.fabricCostAssistList,class:'.costInvoice-ingredient-table'},
  849. // {List:this.fabricLoss.fabricExpensesList,class:'.costPay-table'},
  850. {List:this.fabricLoss.fabricAccidentList,class:'.accidentBill-table'},
  851. ]
  852. data.map(item=>{
  853. if(item.List.length == 0){
  854. var bb =document.querySelector(item.class)
  855. bb.className = 'noprint'
  856. }
  857. })
  858. },
  859. // 【采购数量】单元格 弹框
  860. purchaseQuantityCustomCell(record) {
  861. return {
  862. on: {
  863. click: event => {
  864. if (record.cpoid == '来源余料') {
  865. this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
  866. this.$refs.surplusYarnModal.allDataList = record.fabricPoOrderOutList;
  867. this.$refs.surplusYarnModal.queryParam = {};
  868. this.$refs.surplusYarnModal.surplusYarnModVis = true
  869. }else if (record.cpoid == '其他入库') {
  870. this.$refs.otherYarnsInModal.otherYarnsInData = record.fabricPoOrderOutList;
  871. this.$refs.otherYarnsInModal.allDataList = record.fabricPoOrderOutList;
  872. this.$refs.otherYarnsInModal.queryParam = {};
  873. this.$refs.otherYarnsInModal.otherYarnsInModVis = true
  874. } else {
  875. this.$refs.purchaseAmountModal.purchaseAmountData = record.fabricPoOrderInList;
  876. this.$refs.purchaseAmountModal.allDataList = record.fabricPoOrderInList;
  877. this.$refs.purchaseAmountModal.queryParam = {};
  878. this.$refs.purchaseAmountModal.purchaseAmountModVis = true
  879. }
  880. }
  881. }
  882. }
  883. },
  884. // 余纱
  885. surplusYarnCustomCell(record) {
  886. return {
  887. on: {
  888. click: event => {
  889. this.$refs.purchaseLeftModal.surplusYarnData = record.fabricPoOrderOutList;
  890. this.$refs.purchaseLeftModal.allDataList = record.fabricPoOrderOutList;
  891. this.$refs.purchaseLeftModal.queryParam = {};
  892. this.$refs.purchaseLeftModal.surplusYarnModVis = true
  893. }
  894. }
  895. }
  896. },
  897. // 【材料出库数量】 弹框
  898. materialsOutQuantityCustomCell(record) {
  899. return {
  900. on: {
  901. click: event => {
  902. this.$refs.materialsOutQuantityModal.materialsOutQuantityData = record.fabricMoOrderCKList;
  903. this.$refs.materialsOutQuantityModal.allDataList = record.fabricMoOrderCKList;
  904. this.$refs.materialsOutQuantityModal.queryParam = {};
  905. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  906. }
  907. }
  908. }
  909. },
  910. // 采购入库数量
  911. purchaseInQuantityCustomCell(record) {
  912. return {
  913. on: {
  914. click: event => {
  915. this.$refs.purchaseInQuantityModal.purchaseInQuantityData = record.fabricMoOrderRKList;
  916. this.$refs.purchaseInQuantityModal.allDataList = record.fabricMoOrderRKList;
  917. this.$refs.purchaseInQuantityModal.queryParam = {};
  918. this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
  919. }
  920. }
  921. }
  922. },
  923. // 开票成本-面料弹框
  924. invoiceNumCustomCell(record) {
  925. return {
  926. on: {
  927. click: event => {
  928. this.$refs.invoiceNumModal.invoiceNumData = record.fabricCostClothDetailList;
  929. this.$refs.invoiceNumModal.allDataList = record.fabricCostClothDetailList;
  930. this.$refs.invoiceNumModal.queryParam = {};
  931. this.$refs.invoiceNumModal.invoiceNumModVis = true;
  932. }
  933. }
  934. }
  935. },
  936. //成本发票 -----合计行
  937. // costFooterShow(data){
  938. // return (
  939. // <a-table
  940. // rowKey={Math.random}
  941. // bordered={false}
  942. // pagination={false}
  943. // columns={this.costInvoiceColumns}
  944. // dataSource={this.costFooterDataSource || []}
  945. // showHeader={false}
  946. // ></a-table>
  947. // )
  948. // },
  949. // 开票成本-成衣 ----合计行
  950. // clothesFooterShow(data) {
  951. // return (
  952. // <a-table
  953. // rowKey={Math.random}
  954. // bordered={false}
  955. // pagination={false}
  956. // columns={this.costInvoiceClothesColumns}
  957. // dataSource={this.clothesFooterDataSource || []}
  958. // showHeader={false}
  959. // ></a-table>
  960. // )
  961. // },
  962. // 开票成本-辅料 ----合计行
  963. // assistFooterShow(data) {
  964. // return (
  965. // <a-table
  966. // rowKey={Math.random}
  967. // bordered={false}
  968. // pagination={false}
  969. // columns={this.costInvoiceIngredientColumns}
  970. // dataSource={this.assistFooterDataSource || []}
  971. // showHeader={false}
  972. // ></a-table>
  973. // )
  974. // },
  975. //费用支出 ----合计行
  976. costPayFooterShow(){
  977. return (
  978. <a-table
  979. rowKey={Math.random}
  980. bordered={false}
  981. pagination={false}
  982. columns={this.costPayColumns}
  983. dataSource={this.costPayFooterDataSource || []}
  984. showHeader={false}
  985. ></a-table>
  986. )
  987. },
  988. //事故单 -----合计
  989. // accidentFooterShow(){
  990. // return (
  991. // <a-table
  992. // rowKey={Math.random}
  993. // bordered={false}
  994. // pagination={false}
  995. // columns={this.accidentListColumns}
  996. // dataSource={this.accidentFooterDataSource || []}
  997. // showHeader={false}
  998. // ></a-table>
  999. // )
  1000. // },
  1001. // 开票成本-面料 ----合计行
  1002. clothFooterShow(data) {
  1003. return (
  1004. <a-table
  1005. rowKey={Math.random}
  1006. bordered={false}
  1007. pagination={false}
  1008. columns={this.costInvoiceFabricColumns}
  1009. dataSource={this.clothFooterDataSource || []}
  1010. showHeader={false}
  1011. ></a-table>
  1012. )
  1013. },
  1014. // 开票成本成衣-弹框
  1015. clInvoiceQuantityCustomCell(record) {
  1016. return {
  1017. on: {
  1018. click: event => {
  1019. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostClothesDetailList;
  1020. this.$refs.invoiceQuantityModal.allDataList = record.fabricCostClothesDetailList;
  1021. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true;
  1022. }
  1023. }
  1024. }
  1025. },
  1026. // 开票成本辅料-弹框
  1027. ingredientsInvoiceQuantityCustomCell(record) {
  1028. return {
  1029. on: {
  1030. click: event => {
  1031. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostAssistDetailList;
  1032. this.$refs.invoiceQuantityModal.allDataList = record.fabricCostAssistDetailList;
  1033. this.$refs.invoiceQuantityModal.queryParam = {};
  1034. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
  1035. }
  1036. }
  1037. }
  1038. },
  1039. // 事故单 单号 弹框
  1040. accidentListCustomCell(record) {
  1041. return {
  1042. on: {
  1043. click: event => {
  1044. console.log('this:', this)
  1045. this.$refs.accidentListModal.accidentListModVis = true
  1046. }
  1047. }
  1048. }
  1049. },
  1050. save() {
  1051. const that = this
  1052. if (this.fabricLoss.makingPeople == null){
  1053. that.$message.info('没有可保存的数据,请先查询数据');
  1054. return;
  1055. }
  1056. this.confirmLoading = true;
  1057. console.log(this.fabricLoss);
  1058. saveFabricLossData(this.fabricLoss).then(res => {
  1059. that.confirmLoading = false;
  1060. if (res.success) {
  1061. this.$message.success(res.message);
  1062. that.fabricLoss = res.result;
  1063. }else{
  1064. this.$message.error(res.message)
  1065. }
  1066. });
  1067. },
  1068. // 附件
  1069. openEnclosure(){
  1070. this.$refs.attachmentDisplay.AttachmentModVis = true
  1071. var attachList = [];
  1072. if (this.fabricLoss != null && this.fabricLoss.accessorItemList != null){
  1073. this.fabricLoss.accessorItemList.forEach(e=>{
  1074. var attach = {};
  1075. attach.name = e.filename;
  1076. attach.src=e.fileurl;
  1077. attachList.push(attach);
  1078. });
  1079. }
  1080. this.$refs.attachmentDisplay.attachmentData = attachList;
  1081. },
  1082. openItemOnclosure(record){
  1083. var attachList = [];
  1084. record.accessorItemList.forEach(e=>{
  1085. var attach = {};
  1086. attach.name = e.filename;
  1087. attach.src=e.fileurl;
  1088. attachList.push(attach);
  1089. });
  1090. this.$refs.attachmentDisplay.AttachmentModVis = true
  1091. this.$refs.attachmentDisplay.attachmentData = attachList;
  1092. },
  1093. // father
  1094. aa() {},
  1095. bb() {},
  1096. cc() {},
  1097. dd() {},
  1098. ee() {},
  1099. ff() {},
  1100. gg() {}
  1101. },
  1102. // 出现滚动条,合计栏跟随 table 滚动
  1103. // watch: {
  1104. // dataSource(val) {
  1105. // console.log(val)
  1106. // // 同步表与footer滚动
  1107. // let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
  1108. // dom.addEventListener(
  1109. // 'scroll',
  1110. // () => {
  1111. // this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
  1112. // console.log('走到这')
  1113. // },
  1114. // true
  1115. // )
  1116. // }
  1117. // },
  1118. // 构建合计数据 --合计
  1119. computed: {
  1120. // costFooterDataSource(){
  1121. // //成本发票 合计
  1122. // var item = {
  1123. // "cbusType":"合计"
  1124. // };
  1125. // var imoney = 0;
  1126. // for (let row of this.fabricLoss.fabricCostInvoiceList){
  1127. // imoney += row.imoney*1;
  1128. // }
  1129. // item.imoney= parseFloat(imoney.toFixed(2));
  1130. // return [item];
  1131. // },
  1132. // clothFooterDataSource() {
  1133. // // 开票成本-面料 合计
  1134. // var item = {
  1135. // "csbvcode":"合计"
  1136. // };
  1137. // var inatSum = 0;
  1138. // for (let row of this.fabricLoss.fabricCostClothList){
  1139. // inatSum += row.inatSum*1;
  1140. // }
  1141. // item.inatSum= parseFloat(inatSum.toFixed(2));
  1142. // return [item];
  1143. // },
  1144. // clothesFooterDataSource() {
  1145. // // 开票成本-衬衣 合计
  1146. // var item = {
  1147. // "cpbvcode":"合计"
  1148. // };
  1149. // var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
  1150. // for (let row of this.fabricLoss.fabricCostClothesList){
  1151. // isum += row.isum*1;
  1152. // ioriSum += row.ioriSum*1;
  1153. // iquantity += row.iquantity*1;
  1154. // ipbvquantity += row.ipbvquantity*1;
  1155. // }
  1156. // item.isum= parseFloat(isum.toFixed(2));
  1157. // item.ioriSum = parseFloat(ioriSum.toFixed(2));
  1158. // item.iquantity = parseFloat(iquantity.toFixed(4));
  1159. // item.ipbvquantity = parseFloat(ipbvquantity.toFixed(4));
  1160. // return [item];
  1161. // },
  1162. // assistFooterDataSource() {
  1163. // // 开票成本-辅料 合计
  1164. // var item = {
  1165. // "caccount":"合计"
  1166. // };
  1167. // var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
  1168. // for (let row of this.fabricLoss.fabricCostAssistList){
  1169. // isum += row.isum*1;
  1170. // ioriSum += row.ioriSum*1;
  1171. // iquantity += row.iquantity*1;
  1172. // iquantityIn += row.iquantityIn*1;
  1173. // iquantityInvoice += row.iquantityInvoice*1;
  1174. // }
  1175. // item.isum= parseFloat(isum.toFixed(2));
  1176. // item.ioriSum = parseFloat(ioriSum.toFixed(2));
  1177. // item.iquantity = parseFloat(iquantity.toFixed(4));
  1178. // item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
  1179. // item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
  1180. // return [item];
  1181. // },
  1182. costPayFooterDataSource(){
  1183. //费用支出 合计
  1184. var item = {
  1185. "cspvcode":"合计"
  1186. };
  1187. var inatMoney = 0,imoney=0
  1188. for (let row of this.fabricLoss.fabricExpensesList){
  1189. inatMoney += row.inatMoney*1;
  1190. if(row.inatMoney == row.imoney ){
  1191. imoney += 0
  1192. }else{
  1193. imoney += row.imoney*1
  1194. }
  1195. }
  1196. item.inatMoney = parseFloat(inatMoney.toFixed(4));
  1197. item.imoney = parseFloat(imoney.toFixed(4));
  1198. return [item];
  1199. },
  1200. // accidentFooterDataSource(){
  1201. // //事故单 合计
  1202. // var item = {
  1203. // "cvenAbbName":"合计"
  1204. // };
  1205. // var ioriSum = 0
  1206. // for (let row of this.fabricLoss.fabricAccidentList){
  1207. // ioriSum += row.ioriSum*1
  1208. // }
  1209. // item.ioriSum = parseFloat(ioriSum.toFixed(4));
  1210. // return [item];
  1211. // }
  1212. }
  1213. }
  1214. </script>
  1215. <style lang="less" scoped>
  1216. @import '~@assets/less/common.less';
  1217. @import '~@assets/less/overwriter.less';
  1218. /deep/ .ant-table-thead > tr > th {
  1219. text-align: center;
  1220. // font-weight: 700;
  1221. }
  1222. /deep/ .ant-table-tbody {
  1223. text-align: center;
  1224. }
  1225. // /deep/ th.replacecolor {
  1226. // background-color: #ccc;
  1227. // }
  1228. /deep/ .ant-table-footer .ant-table.body {
  1229. // overflow: hidden !important;
  1230. }
  1231. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  1232. border: none;
  1233. padding: 0;
  1234. }
  1235. /deep/ .ant-form-item-children {
  1236. display: flex;
  1237. }
  1238. /deep/ form :not(.ant-input-group-wrapper) > .ant-input-group, form .ant-input-group-wrapper{
  1239. width: 65% !important;
  1240. }
  1241. /deep/ .ant-input-group{
  1242. padding-right: 6px !important;
  1243. }
  1244. </style>