fabric-loss-table.vue 46 KB

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