fabric-loss-table.vue 60 KB

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