fabric-loss-table.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398
  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 == '转出成本'"/>
  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:100px;" v-show='showSelect==0'/>
  309. <a-input type="textarea" v-text="fabricLoss.noteOne" style="minHeight:100px;" 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' },
  637. { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
  638. { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
  639. { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
  640. ],
  641. costInvoiceIngredientData: [
  642. { factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
  643. { factory: '森加', type: '尺码标', ingredientsInvoiceQuantity: '3670', invoiceAmountCNY: '1475.6' }
  644. ],
  645. // 费用支出 表头
  646. costPayColumns: [
  647. { title: '账套号', width: 120, dataIndex: 'caccount', className: 'replacecolor' },
  648. { title: '支出单号', width: 120, dataIndex: 'cspvcode', className: 'replacecolor' },
  649. { title: '费用项目', dataIndex: 'cexpName', width: 120, className: 'replacecolor' },
  650. { title: '支出人民币金额', dataIndex: 'inatMoney', width: 120, className: 'replacecolor' },
  651. { title: '支出美元金额', dataIndex: 'imoney', width: 120, className: 'replacecolor',customRender: (text, record, index) => {
  652. if (record.imoney == record.inatMoney)
  653. return "";
  654. else
  655. return record.imoney;
  656. } },
  657. { title: '发票号', dataIndex: 'cinvoinceNo', width: 120, className: 'replacecolor' },
  658. { title: '制单人', dataIndex: 'cmaker', width: 120, className: 'replacecolor' }
  659. ],
  660. costPayData: [{}],
  661. // 事故单 表头
  662. accidentListColumns: [
  663. {
  664. title: '单号',
  665. width: 120,
  666. dataIndex: 'cpbvcode',
  667. className: 'replacecolor',
  668. // customCell: this.accidentListCustomCell,
  669. scopedSlots: { customRender: 'cpbvcode' }
  670. },
  671. {
  672. title: '事故单号',
  673. width: 120,
  674. dataIndex: 'cpbvmemo',
  675. className: 'replacecolor',
  676. // customCell: this.accidentListCustomCell,
  677. // scopedSlots: { customRender: 'cpbvcode' }
  678. },
  679. { title: '事故承担方', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
  680. { title: '金额', dataIndex: 'ioriSum', width: 120, className: 'replacecolor' }
  681. ],
  682. accidentListData: [{ accidentNum: '1100011' }, { accidentNum: '3540011' }],
  683. noteOne: '', // 备注 1
  684. noteTwo: '' // 备注 2
  685. }
  686. },
  687. methods: {
  688. daYin(){
  689. // printJS({
  690. // printable:this.fabricLoss.fabricOMOrderList1,
  691. // properties:[
  692. // {field:'cvcname',displayName:'制造工艺',columnSize:1},
  693. // {field:'cvenAbbName',displayName:'工厂',columnSize:1},
  694. // {field:'iquantityOut',displayName:'材料出库数量',columnSize:1},
  695. // {field:'iquantity', displayName:'计划数量',columnSize:1},
  696. // {field:'iquantityIn', displayName:'采购入库数量',columnSize:1},
  697. // {field:'cinvCode', displayName:'物料编码',columnSize:1},
  698. // {field:'cinvName', displayName:'货物名称',columnSize:1},
  699. // {field:'ccolor', displayName:'颜色',columnSize:1},
  700. // {field:'cquantityLoss', displayName:'损耗',columnSize:1},
  701. // {field:'iquantityMoreLess', displayName:'多发少发',columnSize:1},
  702. // ],
  703. // type:'json',
  704. // header:'C001',
  705. //样式设置
  706. // gridStyle:'border:2px solid #3971A5;text-align: center',
  707. // gridHeaderStyle:'color:red; border:2px solid #3971A5;'
  708. // })
  709. this.showSelect = 1
  710. this.$nextTick(() => {
  711. const html = window.document.getElementById('fabricLossTable').innerHTML
  712. const win = window.open();
  713. const style = '<style>\n'
  714. +'.noprint{display:none}'
  715. +'.ant-table-body{overflow-x: hidden !important }' //去除滚动条
  716. +'.kk{display:flex;flex-wrap: wrap}' //主要信息并排
  717. +'.ant-col-sm-8{width:40%;margin-bottom: 6px;}'
  718. +'.ant-form-item-label{width:45%;font-size: 12px;}'
  719. +'.ant-form-item-children{font-size: 12px}'
  720. +'.ant-card-head-title{font-weight: bold;font-size: 0.67em;margin-bottom: 9px;}'
  721. +'.ant-form-item-control-wrapper{width:100%}'
  722. +'.ant-input{width:100%}'
  723. +'.ant-form-item{display:flex}'
  724. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  725. + 'th,td{width:5%;height: 18px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px;text-align: center;}\n'
  726. +'.ant-table-row-cell-break-word{width:5% !important}'
  727. + 'th{color: #333}\n'
  728. + 'a{color: #666; text-decoration:none;}\n'
  729. + '</style>';
  730. win.document.write(style+html);
  731. win.focus();
  732. win.print();
  733. win.close();
  734. this.showSelect = 0
  735. })
  736. },
  737. // 【计划单号】 搜索
  738. onSearch(value,update) {
  739. if (value == "" || value == null){
  740. this.$message.error('请输入计划号!');
  741. }else{
  742. this.loading = true;
  743. this.$nextTick(() => {
  744. getFabricLossDatas({csocode:value,update:update}).then(res => {
  745. this.loading = false;
  746. if (res.success) {
  747. this.PrintButton = false
  748. this.fabricLoss = res.result;
  749. this.edit = this.fabricLoss.edit
  750. // 开票成本成衣:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  751. var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
  752. if (findList.length == 0)
  753. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsM1;
  754. else
  755. this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsAll;
  756. // 开票成本辅料:获取原币和本币金额是否完全相同,完全相同隐藏美元列
  757. findList = this.fabricLoss.fabricCostAssistList.filter(e=>e.ioriSum!=e.isum);
  758. if (findList.length == 0)
  759. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsM1;
  760. else
  761. this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
  762. // 委外订单国内附件按钮状态
  763. this.fabricLoss.fabricOMOrderList1.map(item=>{
  764. item.buttonStatus = false
  765. if(!item.accessorItemList||item.accessorItemList.length == 0 ){
  766. item.buttonStatus = true
  767. }
  768. })
  769. // 委外订单国外附件按钮状态
  770. this.fabricLoss.fabricOMOrderList2.map(item=>{
  771. item.buttonStatus = false
  772. if(!item.accessorItemList||item.accessorItemList.length == 0 ){
  773. item.buttonStatus = true
  774. }
  775. })
  776. this.fabricLoss.fabricCostClothesList.map((item,index) => {item.index = index +1})
  777. this.fabricLoss.fabricCostClothList.map((item,index) => {item.index = index +1})
  778. this.fabricLoss.fabricCostAssistList.map((item,index) => {item.index = index +1})
  779. this.fabricLoss.fabricPoOrderList.map(item => {
  780. item["omcVenAbbNameArray"] = item.omcVenAbbName ? (item.omcVenAbbName.split(",")) : ''
  781. })
  782. if (this.fabricLoss.fabricAccidentList == null){
  783. this.fabricLoss.fabricAccidentList = [];
  784. }
  785. this.calculateTotal()
  786. }else{
  787. this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]};
  788. this.$message.info(res.message);
  789. }
  790. this.judgeListLength()
  791. })
  792. })
  793. }
  794. },
  795. //计算合计行
  796. calculateTotal(){
  797. //计算成本发票合计
  798. var imoney = 0;
  799. for (let row of this.fabricLoss.fabricCostInvoiceList){
  800. imoney += row.imoney*1;
  801. }
  802. if(this.fabricLoss.fabricCostInvoiceList.length !==0){
  803. this.fabricLoss.fabricCostInvoiceList.push({
  804. cvcname:'',
  805. cbusType:'合计',
  806. cvenAbbName:'',
  807. imoney:parseFloat(imoney.toFixed(2))
  808. })
  809. }
  810. //计算开票成本-面料合计
  811. var inatSum = 0;
  812. for (let row of this.fabricLoss.fabricCostClothList){
  813. inatSum += row.inatSum*1;
  814. }
  815. if(this.fabricLoss.fabricCostClothList.length !==0){
  816. this.fabricLoss.fabricCostClothList.push({
  817. index:'',
  818. csbvcode:'合计',
  819. cvenName:'',
  820. inatSum:parseFloat(inatSum.toFixed(2)),
  821. cshipTime:''
  822. })
  823. }
  824. //计算开票成本-成衣合计
  825. var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
  826. for (let row of this.fabricLoss.fabricCostClothesList){
  827. isum += row.isum*1;
  828. ioriSum += row.ioriSum*1;
  829. iquantity += row.iquantity*1;
  830. ipbvquantity += row.ipbvquantity*1;
  831. }
  832. if(this.fabricLoss.fabricCostClothesList.length!==0){
  833. this.fabricLoss.fabricCostClothesList.push({
  834. cpbvcode:'合计',
  835. isum: parseFloat(isum.toFixed(2)),
  836. ioriSum: parseFloat(ioriSum.toFixed(2)),
  837. iquantity: parseFloat(iquantity.toFixed(4)),
  838. ipbvquantity: parseFloat(ipbvquantity.toFixed(4)),
  839. })
  840. }
  841. //开票成本-辅料合计
  842. var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
  843. for (let row of this.fabricLoss.fabricCostAssistList){
  844. isum += row.isum*1;
  845. ioriSum += row.ioriSum*1;
  846. iquantity += row.iquantity*1;
  847. iquantityIn += row.iquantityIn*1;
  848. iquantityInvoice += row.iquantityInvoice*1;
  849. }
  850. if(this.fabricLoss.fabricCostAssistList.length !== 0){
  851. this.fabricLoss.fabricCostAssistList.push({
  852. caccount:'合计',
  853. isum:parseFloat(isum.toFixed(2)),
  854. ioriSum:parseFloat(ioriSum.toFixed(2)),
  855. iquantity:parseFloat(iquantity.toFixed(4)),
  856. iquantityIn:parseFloat(iquantityIn.toFixed(4)),
  857. iquantityInvoice:parseFloat(iquantityInvoice.toFixed(4))
  858. })
  859. }
  860. //事故单合计
  861. var item = {
  862. "cvenAbbName":"合计"
  863. };
  864. var ioriSum = 0
  865. for (let row of this.fabricLoss.fabricAccidentList){
  866. ioriSum += row.ioriSum*1
  867. }
  868. if(this.fabricLoss.fabricAccidentList.length !== 0){
  869. this.fabricLoss.fabricAccidentList.push({
  870. cvenAbbName:"合计",
  871. ioriSum:parseFloat(ioriSum.toFixed(4))
  872. })
  873. }
  874. },
  875. //判断哪个列表为空
  876. judgeListLength(){
  877. var data = [
  878. {List:this.fabricLoss.fabricPoOrderList,class:'.purchase-order-table'},
  879. {List:this.fabricLoss.fabricOMOrderList1,class:'.outsource-orders-table'},
  880. {List:this.fabricLoss.fabricOMOrderList2,class:'.outsourceOrder-abroad-table'},
  881. {List:this.fabricLoss.fabricCostInvoiceList,class:'.cost-invoice-table'},
  882. {List:this.fabricLoss.fabricCostClothList,class:'.costInvoice-fabric-table'},
  883. {List:this.fabricLoss.fabricCostClothesList,class:'.costInvoice-clothes-table'},
  884. {List:this.fabricLoss.fabricCostAssistList,class:'.costInvoice-ingredient-table'},
  885. // {List:this.fabricLoss.fabricExpensesList,class:'.costPay-table'},
  886. {List:this.fabricLoss.fabricAccidentList,class:'.accidentBill-table'},
  887. ]
  888. data.map(item=>{
  889. if(item.List.length == 0){
  890. var bb =document.querySelector(item.class)
  891. bb.className = 'noprint'
  892. }
  893. })
  894. },
  895. //行样式
  896. setRowClassName(record) {
  897. return(record.iquantityLeft!==0&&record.fabricPoOrderOutList.length == 0) ? "inputRowStyl" : "inputRowSty2";//赋予点击行样式
  898. },
  899. // 【采购数量】单元格 弹框
  900. purchaseQuantityCustomCell(record) {
  901. return {
  902. on: {
  903. click: event => {
  904. if (record.cpoid == '来源余料') {
  905. this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
  906. this.$refs.surplusYarnModal.allDataList = record.fabricPoOrderOutList;
  907. this.$refs.surplusYarnModal.surplusYarnModVis = true
  908. }else if (record.cpoid == '其他入库') {
  909. this.$refs.otherYarnsInModal.otherYarnsInData = record.fabricPoOrderOutList;
  910. this.$refs.otherYarnsInModal.allDataList = record.fabricPoOrderOutList;
  911. this.$refs.otherYarnsInModal.otherYarnsInModVis = true
  912. } else {
  913. this.$refs.purchaseAmountModal.purchaseAmountData = record.fabricPoOrderInList;
  914. this.$refs.purchaseAmountModal.allDataList = record.fabricPoOrderInList;
  915. this.$refs.purchaseAmountModal.purchaseAmountModVis = true
  916. }
  917. }
  918. }
  919. }
  920. },
  921. // 余纱
  922. surplusYarnCustomCell(record) {
  923. return {
  924. on: {
  925. click: event => {
  926. this.$refs.purchaseLeftModal.surplusYarnData = record.fabricPoOrderOutList;
  927. this.$refs.purchaseLeftModal.allDataList = record.fabricPoOrderOutList;
  928. this.$refs.purchaseLeftModal.surplusYarnModVis = true
  929. }
  930. }
  931. }
  932. },
  933. iquantityMoreLessCell(record){
  934. return {
  935. on: {
  936. click: event => {
  937. this.$refs.iquantityMoreLessModal.surplusYarnData = record.fabricPoOrderOutList;
  938. this.$refs.iquantityMoreLessModal.allDataList = record.fabricPoOrderOutList;
  939. this.$refs.iquantityMoreLessModal.surplusYarnModVis = true
  940. }
  941. }
  942. }
  943. },
  944. //成本金额弹窗
  945. imoneyCell(record){
  946. this.$refs.imoneyCell.imoneyModVis = true
  947. this.$refs.imoneyCell.imoneyData = record.costInvoiceDetailList
  948. },
  949. // 【材料出库数量】 弹框
  950. materialsOutQuantityCustomCell(record) {
  951. return {
  952. on: {
  953. click: event => {
  954. this.$refs.materialsOutQuantityModal.materialsOutQuantityData = record.fabricMoOrderCKList;
  955. this.$refs.materialsOutQuantityModal.allDataList = record.fabricMoOrderCKList;
  956. this.$refs.materialsOutQuantityModal.queryParam = {};
  957. this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
  958. }
  959. }
  960. }
  961. },
  962. // 采购入库数量
  963. purchaseInQuantityCustomCell(record) {
  964. return {
  965. on: {
  966. click: event => {
  967. this.$refs.purchaseInQuantityModal.purchaseInQuantityData = record.fabricMoOrderRKList;
  968. this.$refs.purchaseInQuantityModal.allDataList = record.fabricMoOrderRKList;
  969. this.$refs.purchaseInQuantityModal.queryParam = {};
  970. this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
  971. }
  972. }
  973. }
  974. },
  975. // 开票成本-面料弹框
  976. invoiceNumCustomCell(record) {
  977. if(record.csbvcode!=='合计'){
  978. return {
  979. on: {
  980. click: event => {
  981. this.$refs.invoiceNumModal.invoiceNumData = record.fabricCostClothDetailList;
  982. this.$refs.invoiceNumModal.allDataList = record.fabricCostClothDetailList;
  983. this.$refs.invoiceNumModal.queryParam = {};
  984. this.$refs.invoiceNumModal.invoiceNumModVis = true;
  985. }
  986. }
  987. }
  988. }
  989. },
  990. //成本发票 -----合计行
  991. // costFooterShow(data){
  992. // return (
  993. // <a-table
  994. // rowKey={Math.random}
  995. // bordered={false}
  996. // pagination={false}
  997. // columns={this.costInvoiceColumns}
  998. // dataSource={this.costFooterDataSource || []}
  999. // showHeader={false}
  1000. // ></a-table>
  1001. // )
  1002. // },
  1003. // 开票成本-成衣 ----合计行
  1004. // clothesFooterShow(data) {
  1005. // return (
  1006. // <a-table
  1007. // rowKey={Math.random}
  1008. // bordered={false}
  1009. // pagination={false}
  1010. // columns={this.costInvoiceClothesColumns}
  1011. // dataSource={this.clothesFooterDataSource || []}
  1012. // showHeader={false}
  1013. // ></a-table>
  1014. // )
  1015. // },
  1016. // 开票成本-辅料 ----合计行
  1017. // assistFooterShow(data) {
  1018. // return (
  1019. // <a-table
  1020. // rowKey={Math.random}
  1021. // bordered={false}
  1022. // pagination={false}
  1023. // columns={this.costInvoiceIngredientColumns}
  1024. // dataSource={this.assistFooterDataSource || []}
  1025. // showHeader={false}
  1026. // ></a-table>
  1027. // )
  1028. // },
  1029. //费用支出 ----合计行
  1030. costPayFooterShow(){
  1031. return (
  1032. <a-table
  1033. rowKey={Math.random}
  1034. bordered={false}
  1035. pagination={false}
  1036. columns={this.costPayColumns}
  1037. dataSource={this.costPayFooterDataSource || []}
  1038. showHeader={false}
  1039. ></a-table>
  1040. )
  1041. },
  1042. //事故单 -----合计
  1043. // accidentFooterShow(){
  1044. // return (
  1045. // <a-table
  1046. // rowKey={Math.random}
  1047. // bordered={false}
  1048. // pagination={false}
  1049. // columns={this.accidentListColumns}
  1050. // dataSource={this.accidentFooterDataSource || []}
  1051. // showHeader={false}
  1052. // ></a-table>
  1053. // )
  1054. // },
  1055. // 开票成本-面料 ----合计行
  1056. clothFooterShow(data) {
  1057. return (
  1058. <a-table
  1059. rowKey={Math.random}
  1060. bordered={false}
  1061. pagination={false}
  1062. columns={this.costInvoiceFabricColumns}
  1063. dataSource={this.clothFooterDataSource || []}
  1064. showHeader={false}
  1065. ></a-table>
  1066. )
  1067. },
  1068. // 开票成本成衣-弹框
  1069. clInvoiceQuantityCustomCell(record) {
  1070. return {
  1071. on: {
  1072. click: event => {
  1073. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostClothesDetailList;
  1074. this.$refs.invoiceQuantityModal.allDataList = record.fabricCostClothesDetailList;
  1075. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true;
  1076. }
  1077. }
  1078. }
  1079. },
  1080. // 开票成本辅料-弹框
  1081. ingredientsInvoiceQuantityCustomCell(record) {
  1082. if(record.caccount!=='合计'){
  1083. return {
  1084. on: {
  1085. click: event => {
  1086. this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostAssistDetailList;
  1087. this.$refs.invoiceQuantityModal.allDataList = record.fabricCostAssistDetailList;
  1088. this.$refs.invoiceQuantityModal.queryParam = {};
  1089. this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
  1090. }
  1091. }
  1092. }
  1093. }
  1094. },
  1095. // 事故单 单号 弹框
  1096. accidentListCustomCell(record) {
  1097. return {
  1098. on: {
  1099. click: event => {
  1100. console.log('this:', this)
  1101. this.$refs.accidentListModal.accidentListModVis = true
  1102. }
  1103. }
  1104. }
  1105. },
  1106. save() {
  1107. const that = this
  1108. if (this.fabricLoss.makingPeople == null){
  1109. that.$message.info('没有可保存的数据,请先查询数据');
  1110. return;
  1111. }
  1112. this.loadingBtn = true;
  1113. console.log(this.fabricLoss);
  1114. saveFabricLossData(this.fabricLoss).then(res => {
  1115. that.loadingBtn = false;
  1116. if (res.success) {
  1117. this.$message.success(res.message);
  1118. that.fabricLoss = res.result;
  1119. }else{
  1120. this.$message.error(res.message)
  1121. }
  1122. });
  1123. },
  1124. // 附件
  1125. openEnclosure(){
  1126. this.$refs.attachmentDisplay.AttachmentModVis = true
  1127. var attachList = [];
  1128. if (this.fabricLoss != null && this.fabricLoss.accessorItemList != null){
  1129. this.fabricLoss.accessorItemList.forEach(e=>{
  1130. var attach = {};
  1131. attach.name = e.filename;
  1132. attach.src=e.fileurl;
  1133. attachList.push(attach);
  1134. });
  1135. }
  1136. this.$refs.attachmentDisplay.attachmentData = attachList;
  1137. },
  1138. openItemOnclosure(record){
  1139. var attachList = [];
  1140. record.accessorItemList.forEach(e=>{
  1141. var attach = {};
  1142. attach.name = e.filename;
  1143. attach.src=e.fileurl;
  1144. attachList.push(attach);
  1145. });
  1146. this.$refs.attachmentDisplay.AttachmentModVis = true
  1147. this.$refs.attachmentDisplay.attachmentData = attachList;
  1148. },
  1149. // father
  1150. aa() {},
  1151. bb() {},
  1152. cc() {},
  1153. dd() {},
  1154. ee() {},
  1155. ff() {},
  1156. gg() {}
  1157. },
  1158. // 出现滚动条,合计栏跟随 table 滚动
  1159. // watch: {
  1160. // dataSource(val) {
  1161. // console.log(val)
  1162. // // 同步表与footer滚动
  1163. // let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
  1164. // dom.addEventListener(
  1165. // 'scroll',
  1166. // () => {
  1167. // this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
  1168. // console.log('走到这')
  1169. // },
  1170. // true
  1171. // )
  1172. // }
  1173. // },
  1174. // 构建合计数据 --合计
  1175. computed: {
  1176. // costFooterDataSource(){
  1177. // //成本发票 合计
  1178. // var item = {
  1179. // "cbusType":"合计"
  1180. // };
  1181. // var imoney = 0;
  1182. // for (let row of this.fabricLoss.fabricCostInvoiceList){
  1183. // imoney += row.imoney*1;
  1184. // }
  1185. // item.imoney= parseFloat(imoney.toFixed(2));
  1186. // return [item];
  1187. // },
  1188. // clothFooterDataSource() {
  1189. // // 开票成本-面料 合计
  1190. // var item = {
  1191. // "csbvcode":"合计"
  1192. // };
  1193. // var inatSum = 0;
  1194. // for (let row of this.fabricLoss.fabricCostClothList){
  1195. // inatSum += row.inatSum*1;
  1196. // }
  1197. // item.inatSum= parseFloat(inatSum.toFixed(2));
  1198. // return [item];
  1199. // },
  1200. // clothesFooterDataSource() {
  1201. // // 开票成本-衬衣 合计
  1202. // var item = {
  1203. // "cpbvcode":"合计"
  1204. // };
  1205. // var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
  1206. // for (let row of this.fabricLoss.fabricCostClothesList){
  1207. // isum += row.isum*1;
  1208. // ioriSum += row.ioriSum*1;
  1209. // iquantity += row.iquantity*1;
  1210. // ipbvquantity += row.ipbvquantity*1;
  1211. // }
  1212. // item.isum= parseFloat(isum.toFixed(2));
  1213. // item.ioriSum = parseFloat(ioriSum.toFixed(2));
  1214. // item.iquantity = parseFloat(iquantity.toFixed(4));
  1215. // item.ipbvquantity = parseFloat(ipbvquantity.toFixed(4));
  1216. // return [item];
  1217. // },
  1218. // assistFooterDataSource() {
  1219. // // 开票成本-辅料 合计
  1220. // var item = {
  1221. // "caccount":"合计"
  1222. // };
  1223. // var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
  1224. // for (let row of this.fabricLoss.fabricCostAssistList){
  1225. // isum += row.isum*1;
  1226. // ioriSum += row.ioriSum*1;
  1227. // iquantity += row.iquantity*1;
  1228. // iquantityIn += row.iquantityIn*1;
  1229. // iquantityInvoice += row.iquantityInvoice*1;
  1230. // }
  1231. // item.isum= parseFloat(isum.toFixed(2));
  1232. // item.ioriSum = parseFloat(ioriSum.toFixed(2));
  1233. // item.iquantity = parseFloat(iquantity.toFixed(4));
  1234. // item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
  1235. // item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
  1236. // return [item];
  1237. // },
  1238. costPayFooterDataSource(){
  1239. //费用支出 合计
  1240. var item = {
  1241. "cspvcode":"合计"
  1242. };
  1243. var inatMoney = 0,imoney=0
  1244. for (let row of this.fabricLoss.fabricExpensesList){
  1245. inatMoney += row.inatMoney*1;
  1246. if(row.inatMoney == row.imoney ){
  1247. imoney += 0
  1248. }else{
  1249. imoney += row.imoney*1
  1250. }
  1251. }
  1252. item.inatMoney = parseFloat(inatMoney.toFixed(4));
  1253. item.imoney = parseFloat(imoney.toFixed(4));
  1254. return [item];
  1255. },
  1256. // accidentFooterDataSource(){
  1257. // //事故单 合计
  1258. // var item = {
  1259. // "cvenAbbName":"合计"
  1260. // };
  1261. // var ioriSum = 0
  1262. // for (let row of this.fabricLoss.fabricAccidentList){
  1263. // ioriSum += row.ioriSum*1
  1264. // }
  1265. // item.ioriSum = parseFloat(ioriSum.toFixed(4));
  1266. // return [item];
  1267. // }
  1268. }
  1269. }
  1270. </script>
  1271. <style lang="less" scoped>
  1272. @import '~@assets/less/common.less';
  1273. @import '~@assets/less/overwriter.less';
  1274. /deep/ .ant-table-thead > tr > th {
  1275. text-align: center;
  1276. // font-weight: 700;
  1277. }
  1278. /deep/ .ant-table-tbody {
  1279. text-align: center;
  1280. }
  1281. // /deep/ th.replacecolor {
  1282. // background-color: #ccc;
  1283. // }
  1284. /deep/ .ant-table-footer .ant-table.body {
  1285. // overflow: hidden !important;
  1286. }
  1287. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  1288. border: none;
  1289. padding: 0;
  1290. }
  1291. /deep/ .ant-form-item-children {
  1292. display: flex;
  1293. }
  1294. /deep/ form :not(.ant-input-group-wrapper) > .ant-input-group, form .ant-input-group-wrapper{
  1295. width: 65% !important;
  1296. }
  1297. /deep/ .ant-input-group{
  1298. padding-right: 6px !important;
  1299. }
  1300. /deep/ .ant-table .ant-table-row-indent + .ant-table-row-expand-icon{
  1301. display: none !important;
  1302. }
  1303. </style>