fabric-loss-table.vue 52 KB

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