fabric-loss-table.vue 60 KB

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