fabric-loss-table.vue 53 KB

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