cost-allocation-table.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  1. <template>
  2. <!--报表 成本分配表 (保存后数据到单证的成本分配汇总内)-->
  3. <div id="costAllocationTable">
  4. <h1 class="title">成本分配表</h1>
  5. <a-spin :spinning="loading">
  6. <a-card :bordered="false">
  7. <!-- 主表信息 点击搜索后 回显--->
  8. <a-row :gutter="24">
  9. <div class="table-page-search-wrapper">
  10. <!-- ref="form" :model="costAllocationTable" -->
  11. <a-form-model layout="inline" class="kk">
  12. <a-col :md="6" :sm="8">
  13. <a-form-model-item label="计划单号" prop="plannum">
  14. <a-input-search
  15. placeholder="请输入计划单号"
  16. enter-button
  17. v-model="detailsPlanNum.planNum"
  18. @search="onSearch('query')"
  19. :loading="this.loading"
  20. v-show='showSelect==0'
  21. />
  22. <a-input-search
  23. placeholder="请输入计划单号"
  24. v-text="detailsPlanNum.planNum"
  25. enter-button
  26. @search="onSearch('query')"
  27. v-show='showSelect==1'
  28. />
  29. <a-button type="primary" :disabled="edit == '0'" @click="onSearch('queryNew')" class="noprint">更新</a-button>
  30. </a-form-model-item>
  31. </a-col>
  32. <!-- 回显以下【备注】需要输入,后进行保存 disabled -->
  33. <a-col :md="6" :sm="8">
  34. <a-form-model-item label="产品款号" prop="poStyleNum">
  35. <span :title="detailsPlanNum.poStyleNum">{{ detailsPlanNum.poStyleNum | ellipsis}}</span>
  36. <!-- {{ detailsPlanNum.poStyleNum }} -->
  37. </a-form-model-item>
  38. </a-col>
  39. <a-col :md="6" :sm="8">
  40. <a-form-model-item label="外销员" prop="exportSales">
  41. {{ detailsPlanNum.exportSales }}
  42. </a-form-model-item>
  43. </a-col>
  44. <a-col :md="6" :sm="8">
  45. <a-form-model-item label="成衣合同号" prop="garmentContractno">
  46. {{ detailsPlanNum.garmentContractno }}
  47. </a-form-model-item>
  48. </a-col>
  49. <a-col :md="6" :sm="8">
  50. <a-form-model-item label="部门" prop="department">
  51. {{ detailsPlanNum.department }}
  52. </a-form-model-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-model-item label="客户简称" prop="customerShortame">
  56. {{ detailsPlanNum.customerShortame }}
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :md="6" :sm="8">
  60. <a-form-model-item label="加工单位" prop="processUnit">
  61. <span :title=" detailsPlanNum.processUnit">{{ detailsPlanNum.processUnit | ellipsis}}</span>
  62. <!-- {{ detailsPlanNum.processUnit }} -->
  63. </a-form-model-item>
  64. </a-col>
  65. <a-col :md="6" :sm="8">
  66. <a-form-model-item label="出运日期" prop="outdata">
  67. {{ detailsPlanNum.outdata }}
  68. </a-form-model-item>
  69. </a-col>
  70. <a-col :md="6" :sm="8">
  71. <a-form-model-item label="面料不含税成本(¥)" prop="fabriccostNotincludestax" >
  72. {{ detailsPlanNum.fabriccostNotincludestax }}
  73. </a-form-model-item>
  74. </a-col>
  75. <a-col :md="6" :sm="8">
  76. <a-form-model-item label="辅料不含税成本(¥)" prop="excipiencostNotincludestax">
  77. {{ detailsPlanNum.excipiencostNotincludestax }}
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :md="6" :sm="8">
  81. <a-form-model-item label="外销总价($)" prop="usdTotalexportprice">
  82. {{ detailsPlanNum.usdTotalexportprice }}
  83. </a-form-model-item>
  84. </a-col>
  85. <a-col :md="6" :sm="8">
  86. <a-form-model-item label="外销金额(¥)" prop="rmbExportamount">
  87. {{ detailsPlanNum.rmbExportamount }}
  88. </a-form-model-item>
  89. </a-col>
  90. <a-col :md="6" :sm="8">
  91. <a-form-model-item label="实际出货数量" prop="actualShipquantity">
  92. {{ detailsPlanNum.actualShipquantity }}
  93. </a-form-model-item>
  94. </a-col>
  95. <a-col :md="6" :sm="8">
  96. <a-form-model-item label="不含税加工费(¥)" prop="rmbProcesscost">
  97. {{ detailsPlanNum.rmbProcesscost }}
  98. </a-form-model-item>
  99. </a-col>
  100. <a-col :md="6" :sm="8">
  101. <a-form-model-item label="加工费($)" prop="usdProcesscost">
  102. {{ detailsPlanNum.usdProcesscost }}
  103. </a-form-model-item>
  104. </a-col>
  105. <a-col :md="6" :sm="8">
  106. <a-form-model-item label="运杂费($)" prop="usdExpense" >
  107. <a href="javascript:void(0)" @click="mainTableExpenseUSD()" >{{ detailsPlanNum.usdExpense }}</a>
  108. </a-form-model-item>
  109. </a-col>
  110. <a-col :md="6" :sm="8">
  111. <a-form-model-item label="不含税运杂费(¥)" prop="rmbNorTaxExpense" >
  112. {{detailsPlanNum.rmbNorTaxExpense }}
  113. </a-form-model-item>
  114. </a-col>
  115. <a-col :md="6" :sm="8">
  116. <a-form-model-item label="事故金额($)" prop="accidentUsdamount" >
  117. {{ detailsPlanNum.accidentUsdamount }}
  118. </a-form-model-item>
  119. </a-col>
  120. <a-col :md="6" :sm="8">
  121. <a-form-model-item label="事故金额(¥)" prop="accidentcnyAmount" >
  122. {{ detailsPlanNum.accidentcnyAmount }}
  123. </a-form-model-item>
  124. </a-col>
  125. <a-col :md="6" :sm="8">
  126. <a-form-model-item label="计划数量" prop="planQuantity">
  127. {{ detailsPlanNum.planQuantity }}
  128. </a-form-model-item>
  129. </a-col>
  130. <a-col :md="6" :sm="8">
  131. <a-form-model-item label="短出数" prop="shortseveral" >
  132. {{ detailsPlanNum.shortseveral }}
  133. </a-form-model-item>
  134. </a-col>
  135. <a-col :md="6" :sm="8">
  136. <a-form-model-item label="短出货值" prop="shortvalue" >
  137. {{ detailsPlanNum.shortvalue }}
  138. </a-form-model-item>
  139. </a-col>
  140. <a-col :md="6" :sm="8">
  141. <a-form-model-item label="面料成本($)" prop="fabriccostIncludestaxUsd" >
  142. {{ detailsPlanNum.fabriccostIncludestaxUsd }}
  143. </a-form-model-item>
  144. </a-col>
  145. <a-col :md="6" :sm="8">
  146. <a-form-model-item label="面料成本(¥)" prop="fabriccostIncludestax" >
  147. {{ detailsPlanNum.fabriccostIncludestax }}
  148. </a-form-model-item>
  149. </a-col>
  150. <a-col :md="6" :sm="8">
  151. <a-form-model-item label="辅料成本($)" prop="excipiencostIncludestaxUsd">
  152. {{ detailsPlanNum.excipiencostIncludestaxUsd}}
  153. <!-- {{ detailsPlanNum.excipiencostIncludestaxUsd }} -->
  154. </a-form-model-item>
  155. </a-col>
  156. <a-col :md="6" :sm="8">
  157. <a-form-model-item label="辅料成本(¥)" prop="excipiencostIncludestax">
  158. {{ detailsPlanNum.excipiencostIncludestax }}
  159. </a-form-model-item>
  160. </a-col>
  161. <a-col :md="6" :sm="8">
  162. <a-form-model-item label="销售订单总额(¥)" prop="salesordersLocaltotal">
  163. {{ detailsPlanNum.salesordersLocaltotal }}
  164. </a-form-model-item>
  165. </a-col>
  166. <a-col :md="6" :sm="8">
  167. <a-form-model-item label="销售订单总额($)" prop="salesrrdersOriginaltotal">
  168. {{ detailsPlanNum.salesrrdersOriginaltotal }}
  169. </a-form-model-item>
  170. </a-col>
  171. <a-col :md="6" :sm="8">
  172. <a-form-model-item label="运杂费(¥)" prop="rmbExpense">
  173. <a href="javascript:void(0)" @click="mainTableExpenseCNY()">{{ detailsPlanNum.rmbExpense }}</a>
  174. </a-form-model-item>
  175. </a-col>
  176. <a-col :md="6" :sm="8">
  177. <a-form-model-item label="运费税额" prop="shuiemoney">
  178. {{detailsPlanNum.shuiemoney}}
  179. </a-form-model-item>
  180. </a-col>
  181. <a-col :md="6" :sm="8">
  182. <a-form-model-item label="税率%" prop="taxrate" >
  183. <a-input placeholder="请输入" v-model="detailsPlanNum.taxrate" @blur="changeTaxrate" class="taxrate" v-show='showSelect==0'/>
  184. <span v-show='showSelect==1'>{{ detailsPlanNum.taxrate }}</span>
  185. </a-form-model-item>
  186. </a-col>
  187. <a-col :md="6" :sm="8">
  188. <a-form-model-item label="备注" prop="memo" >
  189. <a-input style="width:100%" type="text" v-model="detailsPlanNum.memo" @blur="changeContainerNumber" v-show='showSelect==0'/>
  190. <span v-show='showSelect==1'>{{ detailsPlanNum.memo }}</span>
  191. </a-form-model-item>
  192. </a-col>
  193. <a-col :md="6" :sm="8">
  194. <a-form-model-item label="制单人" prop="preparedBy">
  195. {{ detailsPlanNum.preparedBy }}
  196. </a-form-model-item>
  197. </a-col>
  198. <a-col :md="6" :sm="8">
  199. <a-form-model-item label="查询时间" prop="queryTime">
  200. {{ detailsPlanNum.queryTime }}
  201. </a-form-model-item>
  202. </a-col>
  203. <a-col :md="6" :sm="8">
  204. <a-form-model-item label="订单汇率" prop="queryTime">
  205. {{ detailsPlanNum.exchangeRate }}
  206. </a-form-model-item>
  207. </a-col>
  208. <a-col :md="6" :sm="8" class="noprint">
  209. <a-form-model-item label="" prop="" >
  210. <h4 style="color:red;" v-if="color1<0">
  211. 标记(A)
  212. <!-- <span>(计算结果是负值时,该标记是红色)</span> -->
  213. </h4>
  214. <h4 style="color:black;" v-else>
  215. 标记(A)
  216. <!-- <span>(计算结果是负值时,该标记是红色)</span> -->
  217. </h4>
  218. </a-form-model-item>
  219. </a-col>
  220. <a-col :md="6" :sm="8" class="noprint">
  221. <a-form-model-item label="" prop="" >
  222. <h4 style="color:blue;" v-if="color2<0.8">
  223. 标记(B)
  224. <!-- <span>(计算结果小于O.8 时,该标记是蓝色)</span> -->
  225. </h4>
  226. <h4 style="color:black;" v-else>
  227. 标记(B)
  228. <!-- <span>(计算结果小于O.8 时,该标记是蓝色)</span> -->
  229. </h4>
  230. </a-form-model-item>
  231. </a-col>
  232. <a-col :md="6" :sm="8" class="noprint">
  233. <a-upload productName="file" :showUploadList="true" :file-list="fileList" :headers="tokenHeader" :multiple="false" :action="importExcelUrl" @change="handleImportExcel" :data="{code:this.detailsPlanNum.planNum,name:this.fileName}" :beforeUpload="uploadFlie" :remove="removeFile">
  234. <a-button type="primary" >附件上传</a-button>
  235. </a-upload>
  236. </a-col>
  237. <a-col :md="6" :sm="8" class="noprint">
  238. <a-button type="primary" @click="openEnclosure">附件</a-button>
  239. </a-col>
  240. </a-form-model>
  241. </div>
  242. </a-row>
  243. </a-card>
  244. <!--tabs 组件引入 -->
  245. <a-card :bordered="false" style=" marginTop:10px;">
  246. <div><tabs ref="unitTabs" :showSelect='showSelect' @number="number" :planNum="this.detailsPlanNum.planNum" @FabInQua="FabInQua"/></div>
  247. </a-card>
  248. <!-- 事故单 -->
  249. <a-card :bordered="true" style="margin:10px 0">
  250. <div style="margin:60px 0 40px 0" :class="[(accidentListData.length==0?'noprint': '')]">
  251. <h6 class="table-title">事故单</h6>
  252. <a-table
  253. rowKey="id"
  254. :columns="accidentListColumns"
  255. :data-source="accidentListData"
  256. bordered
  257. :pagination="false"
  258. :scroll="{ }"
  259. >
  260. <!-- 事故单 -->
  261. <span slot="accidentNum" slot-scope="text,record">
  262. <a :href="'http://www.myfitt.cn:18086/IncidentTicketModalDetail?id='+record.id" target="_blank">{{ text }}</a>
  263. </span>
  264. </a-table>
  265. </div>
  266. <!-- 费用支出 -->
  267. <div :class="[(costPayData.length==0?'noprint': '')]">
  268. <h6 class="table-title" >费用支出</h6>
  269. <a-table
  270. rowKey="id"
  271. :columns="costPayColumns"
  272. :data-source="costPayData"
  273. bordered
  274. :pagination="false"
  275. >
  276. </a-table>
  277. </div>
  278. <!-- 备注信息 根据角色权限控制【填写】、【查看】-->
  279. <div class="note-one" style="marginTop:40px;">
  280. <h6 class="table-title">备注</h6>
  281. <div class="noteDetail">
  282. <a-form-model ref="form" :model="detailsPlanNum">
  283. <a-form-model-item prop="remarks">
  284. <a-input type="textarea" v-model="detailsPlanNum.remarks" placeholder="请输入备注" style="minHeight:100px;" v-show='showSelect==0' />
  285. <a-input type="textarea" v-text="detailsPlanNum.remarks" style="minHeight:100px;" v-show='showSelect==1'/>
  286. </a-form-model-item>
  287. </a-form-model>
  288. </div>
  289. </div>
  290. <!-- 页面底部保存 -->
  291. <a-row :gutter="24" style="marginTop:40px;float:right" class="noprint">
  292. <a-col :md="12" :sm="12" style="display:flex">
  293. <a-button type="primary" @click="daYin" style="margin-right:6px" :disabled ="PrintButton">
  294. 打印
  295. </a-button>
  296. <a-button type="primary" @click="save" :disabled="isDisabled">
  297. 保存
  298. </a-button>
  299. </a-col>
  300. </a-row>
  301. </a-card>
  302. <!-- 弹框 -->
  303. <div>
  304. <!-- 主表 人民币费用支出 弹框 -->
  305. <mainTableExpenseCNY-modal ref="mainTableExpenseCNYModal" :father="aa"></mainTableExpenseCNY-modal>
  306. <!-- 主表 美元费用支出 弹框 -->
  307. <mainTableExpenseUSD-modal ref="mainTableExpenseUSDModal" :father="bb"></mainTableExpenseUSD-modal>
  308. <!-- 事故单 -->
  309. <accidentList-modal ref="accidentListModal" :father="cc"></accidentList-modal>
  310. <!-- 附件 -->
  311. <attachment-display ref="attachmentDisplay"></attachment-display>
  312. </div>
  313. </a-spin>
  314. </div>
  315. </template>
  316. <script>
  317. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  318. import JEllipsis from '@/components/jeecg/JEllipsis'
  319. import moment from 'moment'
  320. import tabs from '@views/reportForms/cost-allocation-table/tabs.vue' // tabs组件
  321. import mainTableExpenseCNYModal from '@views/cost-allocation-total/modal/mainTableExpenseCNYModal.vue'
  322. import mainTableExpenseUSDModal from '@views/cost-allocation-total/modal/mainTableExpenseUSDModal.vue'
  323. import accidentListModal from '@views/cost-allocation-total/modal/accidentListModal.vue' // 事故单
  324. import { seachPlanNum, addHalfInfo,deleteFileDetail } from '@api/document/cost-allocation-total.js'
  325. import AttachmentDisplay from '@views/reportForms/fabric-loss-table/attachment-display.vue'
  326. export default {
  327. name: 'CostAllocationTable', // 成本分配 (新增)
  328. mixins: [JeecgListMixin],
  329. components: { JEllipsis, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal,AttachmentDisplay },
  330. data() {
  331. return {
  332. key: '', //客户输入的订单号
  333. PrintButton:true,//打印按钮
  334. showSelect:0,//计划号是否是输入框
  335. loading: false, // 表格加载
  336. detailsPlanNum: {
  337. planNum: ''
  338. }, // 详情所有数据
  339. remarks: '', // 备注
  340. // 事故单 表头
  341. accidentListColumns: [
  342. {
  343. title: '单号',
  344. width: 120,
  345. dataIndex: 'accidentNumber',
  346. className: 'replacecolor',
  347. customCell: this.accidentListCustomCell,
  348. scopedSlots: { customRender: 'accidentNum' }
  349. },
  350. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  351. {
  352. title: '美元金额',
  353. width: 120,
  354. dataIndex: 'amount',
  355. className: 'replacecolor' ,
  356. customRender: (text, record, index) => {
  357. if(text!==''&&text){
  358. return Number(text).toFixed(2)
  359. }
  360. },
  361. },
  362. {
  363. title: '人民币金额',
  364. width: 120,
  365. dataIndex: 'amountrmb',
  366. className: 'replacecolor' ,
  367. customRender: (text, record, index) => {
  368. if(text!==''&&text){
  369. return Number(text).toFixed(2)
  370. }
  371. },
  372. },
  373. { title: '事故单主题', width: 120, dataIndex: 'accidentTheme', className: 'replacecolor' },
  374. { title: '责任人', width: 100, dataIndex: 'responsibilityPerson1', className: 'replacecolor' },
  375. ],
  376. accidentListData: [],
  377. // 费用支出 表头
  378. costPayColumns: [
  379. { title: '账套号', width: '10%', dataIndex: 'setNo', className: 'replacecolor' },
  380. { title: '支出单号', width: '10%', dataIndex: 'disbursementSlipNo', className: 'replacecolor' },
  381. { title: '费用项目', dataIndex: 'expenseItem', width: '10%', className: 'replacecolor' },
  382. {
  383. title: '美元',
  384. dataIndex: 'disbursedOriginalmoney',
  385. width: '10%',
  386. className: 'replacecolor' ,
  387. customRender: (text, record, index) => {
  388. if(text!==''&&text){
  389. return Number(text).toFixed(2)
  390. }
  391. },
  392. },
  393. {
  394. title: '人民币(不含税)',
  395. dataIndex: 'disbursedLocalmoney',
  396. width: '10%', className: 'replacecolor',
  397. customRender: (text, record, index) => {
  398. if(text!==''&&text){
  399. return Number(text).toFixed(2)
  400. }
  401. },
  402. },
  403. {
  404. title: '人民币(税额)',
  405. dataIndex: 'shuiemoney',
  406. width: '10%',
  407. className: 'replacecolor',
  408. customRender: (text, record, index) => {
  409. if(text!==''&&text){
  410. return Number(text).toFixed(2)
  411. }
  412. },
  413. },
  414. {
  415. title: '人民币(价税合计)',
  416. dataIndex: 'iNatMoney',
  417. width: '10%',
  418. className: 'replacecolor',
  419. customRender: (text, record, index) => {
  420. if(text!==''&&text){
  421. return Number(text).toFixed(2)
  422. }
  423. }, },
  424. { title: '发票号', dataIndex: 'invoicenum', width: '10%', className: 'replacecolor' },
  425. { title: '制单人', dataIndex: 'preparedBy', width: '10%', className: 'replacecolor' }
  426. ],
  427. costPayData: [],
  428. isDisabled: false, //按钮禁止
  429. billstatus: '', // 单据状态
  430. color1:0,
  431. fabricCost:'',//保存表头面料成本(¥)
  432. color2:0,
  433. fileList:[],
  434. url: {
  435. list: '/sys/user/list',
  436. importExcelUrl: 'cost/syCostAllocation/addFile' ,// 导入
  437. }
  438. // dateFormat: 'YYYY-MM-DD',
  439. }
  440. },
  441. created() {
  442. document.title = '成本分配表'+ ' · ' + '马菲羊'
  443. },
  444. filters: {
  445. //文字数超出时,超出部分使用...
  446. ellipsis(value) {
  447. if (!value) return ''
  448. if (value.length > 20) {
  449. return value.slice(0, 20) + '...'
  450. }
  451. return value
  452. }
  453. },
  454. methods: {
  455. // 【计划单号】 搜索
  456. onSearch(data) {
  457. this.$nextTick(() => {
  458. // TODO:接口完善后,type 应改为 add(暂时为了回显数据)
  459. this.fabricCost = ''
  460. this.loading = true
  461. this.$refs.unitTabs.mList = []
  462. this.$refs.unitTabs.fList = []
  463. this.StagingList = [] //更新时重新计算面料成本(¥)使用
  464. var Staging = '',
  465. StagingLast = '',
  466. file = ''
  467. //更新前保存字段
  468. if(data=='queryNew'){
  469. Staging =this.detailsPlanNum.memo
  470. StagingLast = this.detailsPlanNum.remarks
  471. file = this.fileList
  472. this.$refs.unitTabs.mList =this.$refs.unitTabs.tabsAllData.length!==0? this.$refs.unitTabs.tabsAllData[0].syCostAllocationFabricList:[]
  473. this.$refs.unitTabs.fList = this.$refs.unitTabs.tabsAllData.length!==0?this.$refs.unitTabs.tabsAllData[0].syCostAllocationIngredientList:[]
  474. this.StagingList = this.$refs.unitTabs.fabData
  475. }
  476. seachPlanNum({ plannum: this.detailsPlanNum.planNum, type: data }).then(res => {
  477. if (res.success) {
  478. this.PrintButton = false
  479. this.loading = false
  480. this.detailsPlanNum = res.result //所有详情
  481. if(Number(this.detailsPlanNum.shortseveral)<0){
  482. this.detailsPlanNum.shortseveral = 0
  483. this.detailsPlanNum.shortvalue = 0
  484. }
  485. //表头-附件列表
  486. var fileList = (this.detailsPlanNum.attachs!==''&&this.detailsPlanNum.attachs)?this.detailsPlanNum.attachs.split(","):[]
  487. this.fileList = []
  488. if(fileList.length!==0){
  489. fileList.map(item=>{
  490. this.fileList.push({
  491. uid: '-1',
  492. name: item,
  493. status: 'done',
  494. url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+item
  495. })
  496. })
  497. }
  498. this.accidentListData = res.result.syCostAllocationAccidentList //事故单
  499. this.accidentCalculation(this.accidentListData) //计算事故单美元金额和事故单人民币金额
  500. this.costPayData = res.result.syCostAllocationCostpayList //支出费用
  501. var num = 0
  502. this.costPayData.map(item =>{
  503. item.id = num + 1
  504. num += 1
  505. })
  506. // tabs 名称集合
  507. this.$refs.unitTabs.tabNameList = res.result.processUnit.split(',')
  508. //所有tabs数据
  509. this.$refs.unitTabs.tabsAllData = res.result.processUnitList
  510. // 页面打开加载的数据
  511. var oneData = this.$refs.unitTabs.tabsAllData[0]
  512. this.$refs.unitTabs.fabData = oneData.syCostAllocationFabricList
  513. var all = 0,//面料sheet-转入成本总计
  514. allYu = 0//面料sheet-余下数量成本总计
  515. this.$refs.unitTabs.fabData.map(item=>{
  516. if(item.remainingQuantitycost!=='' && item.remainingQuantitycost){
  517. item.remainingQuantitycost = Number(item.remainingQuantitycost).toFixed(2)
  518. allYu +=Number(item.remainingQuantitycost)
  519. }
  520. if(item.transferCost&&item.transferCost!==''){
  521. all+=Number(item.transferCost)
  522. }
  523. })
  524. this.fabricCost =res.result.fabriccostIncludestax
  525. this.detailsPlanNum.fabriccostIncludestax = (all+Number(this.detailsPlanNum.fabriccostIncludestax)-allYu).toFixed(2) // 表头面料成本(¥)
  526. // this.detailsPlanNum.fabriccostIncludestax = (Number(this.detailsPlanNum.fabriccostIncludestax)-allYu).toFixed(2) // 表头面料成本(¥)
  527. this.detailsPlanNum.fabriccostIncludestaxUsd = (Number(this.detailsPlanNum.fabriccostIncludestax)/1.13/this.detailsPlanNum.exchangeRate).toFixed(2)//表头面料成本($)
  528. this.detailsPlanNum.fabriccostNotincludestax = (Number(this.detailsPlanNum.fabriccostIncludestax)/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)//表头-面料不含税成本(¥)
  529. this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList //辅料sheet数据源
  530. this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetail //发运明细sheet数据源
  531. this.detailsPlanNum.outdata = oneData.syCostAllocationShipdetail.length!==0?oneData.syCostAllocationShipdetail[0].outdata:'' //表头-出运日期
  532. this.addAmountIng(oneData.syCostAllocationIngredientList) //辅料sheet合计行
  533. this.addAmountCostPay(this.costPayData) //费用支出合计行
  534. this.addAccident(this.accidentListData)//事故单合计行
  535. this.calculation(oneData.syCostAllocationShipdetail) //出运明细合计行
  536. //合计中面料相关金额
  537. var s=0
  538. oneData.syCostAllocationFabricList.map(item=>{
  539. s+=Number(item.transferCost)
  540. })
  541. this.$refs.unitTabs.sumInfo.fabricAmount = (this.detailsPlanNum.fabriccostIncludestax!==''&&this.detailsPlanNum.fabriccostIncludestax)?(Number(this.detailsPlanNum.fabriccostIncludestax)).toFixed(2):'' //合计中的面料总额
  542. this.$refs.unitTabs.sumInfo.fabricExcludTax =(this.detailsPlanNum.fabriccostNotincludestax!==''&&this.detailsPlanNum.fabriccostNotincludestax)?(Number(this.detailsPlanNum.fabriccostNotincludestax)).toFixed(2):''//合计中的不含税面料总额
  543. //合计中辅料相关金额
  544. var s = 0,
  545. v =0,
  546. t=0
  547. oneData.syCostAllocationIngredientList.map(item=>{
  548. s+=item.priceExcludingtax?Number(item.priceExcludingtax):0,
  549. v+=item.rmbAmount?Number(item.rmbAmount):0
  550. t+=item.transferCost?Number(item.transferCost):0
  551. })
  552. this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
  553. this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
  554. this.detailsPlanNum.excipiencostNotincludestax = ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本
  555. this.detailsPlanNum.excipiencostIncludestax = ( this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
  556. //合计中出运明细相关金额
  557. var s =0,
  558. v = 0,
  559. d = 0,
  560. b = 0,
  561. f=0,
  562. e=0
  563. oneData.syCostAllocationShipdetail.map(item=>{
  564. s+=Number(item.exportPrice)
  565. v+=Number(item.shipQuantity)
  566. d+=Number(item.processCost)
  567. b+=Number(item.rmbAmount)
  568. if(item.outdata!=='合计'){
  569. e+=Number(item.processCostUsd)
  570. }
  571. })
  572. this.$refs.unitTabs.sumInfo.exportPriceUSD = (s/2).toFixed(2)//出运美元外销总价
  573. this.detailsPlanNum.usdTotalexportprice = this.$refs.unitTabs.sumInfo.exportPriceUSD //表头-外销总价($)
  574. this.$refs.unitTabs.sumInfo.shipQua =(v/2).toFixed(4)//出货数量合计
  575. this.$refs.unitTabs.sumInfo.shipProcesFees =(d/2).toFixed(2)//出运加工费
  576. this.$refs.unitTabs.sumInfo.exportedAmountRMB =(b/2).toFixed(2)//出运人民币外销金额 f
  577. this.detailsPlanNum.rmbExportamount = this.$refs.unitTabs.sumInfo.exportedAmountRMB //表头-外销总价(¥)
  578. //调整表头格式
  579. this.adjustingHeader()
  580. if(Number(oneData.syCostAllocationShipdetail[0].procesUnitPriceusd)>0){
  581. this.$refs.unitTabs.sumInfo.excludingTaxProcessing =this.$refs.unitTabs.sumInfo.shipProcesFees//出运不含税加工费-合计信息
  582. }else{
  583. this.$refs.unitTabs.sumInfo.excludingTaxProcessing =( this.$refs.unitTabs.sumInfo.shipProcesFees/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)//出运不含税加工费
  584. }
  585. this.detailsPlanNum.rmbProcesscost = this.$refs.unitTabs.sumInfo.excludingTaxProcessing //表头-加工费人民币
  586. f= Number(this.$refs.unitTabs.sumInfo.excludingTaxProcessing)/Number(this.detailsPlanNum.exchangeRate)
  587. this.detailsPlanNum.usdProcesscost =e==0?(Number(this.detailsPlanNum.rmbProcesscost)/Number(this.detailsPlanNum.exchangeRate)).toFixed(2):e.toFixed(2)//表头-加工费美元
  588. f=Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number(this.$refs.unitTabs.sumInfo.shipProcesFees)
  589. this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
  590. this.pagination = {
  591. total: res.result.total,
  592. current: res.result.current,
  593. pageSize: res.result.size
  594. }
  595. //更新时-面料sheet/辅料sheet-弹窗数据处理
  596. if(data=='queryNew'){
  597. this.detailsPlanNum.memo = Staging
  598. this.detailsPlanNum.remarks = StagingLast
  599. this.fileList = file
  600. var all = 0,
  601. allYu = 0
  602. oneData.syCostAllocationFabricList.map(item=>{
  603. this.$refs.unitTabs.mList.map(event=>{
  604. if(item.goodsName==event.goodsName){
  605. item.transferCost = event.transferCost
  606. item.remainingQuantitycost = event.remainingQuantitycost
  607. }
  608. })
  609. if(item.transferCost&&item.transferCost!==''){
  610. all+=Number(item.transferCost)
  611. }
  612. if(item.remainingQuantitycost&&item.remainingQuantitycost!==''){
  613. allYu+=Number(item.remainingQuantitycost)
  614. }
  615. })
  616. // this.detailsPlanNum.fabriccostIncludestax = (all+Number(this.fabricCost)-allYu).toFixed(2) // 表头面料成本(¥)
  617. this.detailsPlanNum.fabriccostIncludestax = (Number(this.fabricCost)-allYu).toFixed(2) // 表头面料成本(¥)
  618. this.detailsPlanNum.fabriccostIncludestaxUsd = (Number(this.detailsPlanNum.fabriccostIncludestax)/1.13/this.detailsPlanNum.exchangeRate).toFixed(2)//表头面料成本($)
  619. this.detailsPlanNum.fabriccostNotincludestax = (Number(this.detailsPlanNum.fabriccostIncludestax)/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)//表头-面料不含税成本(¥)
  620. this.$refs.unitTabs.sumInfo.fabricAmount=this.detailsPlanNum.fabriccostIncludestax
  621. this.$refs.unitTabs.sumInfo.fabricExcludTax =(this.detailsPlanNum.fabriccostNotincludestax!==''&&this.detailsPlanNum.fabriccostNotincludestax)?(Number(this.detailsPlanNum.fabriccostNotincludestax)).toFixed(2):''//合计中的不含税面料总额
  622. this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
  623. oneData.syCostAllocationIngredientList.map(item=>{
  624. this.$refs.unitTabs.fList.map(event=>{
  625. if(item.goodsName==event.goodsName){
  626. item.transferCost = event.transferCost
  627. }
  628. })
  629. })
  630. //重新计算辅料相关数值
  631. var s = 0,
  632. v=0,
  633. t=0
  634. oneData.syCostAllocationIngredientList.map(item=>{
  635. s+=Number(item.priceExcludingtax),
  636. v+=item.rmbAmount?Number(item.rmbAmount):0
  637. t+=item.transferCost?Number(item.transferCost):0
  638. })
  639. this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
  640. this.detailsPlanNum.excipiencostNotincludestax = ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本
  641. this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
  642. this.detailsPlanNum.excipiencostIncludestax = ( this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
  643. }
  644. }else {
  645. this.loading = false
  646. this.$message.error(res.message);
  647. }
  648. })
  649. })
  650. },
  651. uploadFlie(file) {
  652. this.fileName = file.name
  653. },
  654. handleImportExcel(data){
  655. if(data.fileList.length>this.fileList.length&&data.file.status=='uploading'){
  656. var that =this
  657. setTimeout(()=>{
  658. that.getFileLIst()
  659. },1000)
  660. }
  661. },
  662. getFileLIst(){
  663. seachPlanNum({ plannum: this.detailsPlanNum.planNum, type: 'query' }).then(res => {
  664. if (res.success) {
  665. var fileList = (res.result.attachs!==''&&res.result.attachs)?res.result.attachs.split(","):[]
  666. this.fileList = []
  667. if(fileList.length!==0){
  668. fileList.map(item=>{
  669. this.fileList.push({
  670. uid: '-1',
  671. name: item,
  672. status: 'done',
  673. url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+item
  674. })
  675. })
  676. }
  677. }
  678. })
  679. },
  680. removeFile(data){
  681. deleteFileDetail({code:this.detailsPlanNum.planNum,name:data.name}).then(res => {
  682. if (res.success) {
  683. var cc=[]
  684. this.fileList.map(item=>{
  685. if(item.name !== data.name){
  686. cc.push(item)
  687. }
  688. })
  689. this.fileList = cc
  690. this.loading =false
  691. this.$message.success('删除成功');
  692. }else{
  693. this.$message.error(res.message);
  694. }
  695. })
  696. },
  697. //调整表头格式
  698. adjustingHeader(){
  699. this.detailsPlanNum.planQuantity=( this.detailsPlanNum.planQuantity==''|| !this.detailsPlanNum.planQuantity)?0:Number( this.detailsPlanNum.planQuantity).toFixed(0)//计划数量
  700. this.detailsPlanNum.usdTotalexportprice=( this.detailsPlanNum.usdTotalexportprice==''|| !this.detailsPlanNum.usdTotalexportprice)?0:Number( this.detailsPlanNum.usdTotalexportprice).toFixed(2)//美元外销总价
  701. this.detailsPlanNum.actualShipquantity=( this.detailsPlanNum.actualShipquantity==''|| !this.detailsPlanNum.actualShipquantity)?0:Number( this.detailsPlanNum.actualShipquantity).toFixed(0)//实际出库数量
  702. this.detailsPlanNum.rmbExportamount=( this.detailsPlanNum.rmbExportamount==''|| !this.detailsPlanNum.rmbExportamount)?0:Number( this.detailsPlanNum.rmbExportamount).toFixed(2)//人民币外销金额
  703. this.detailsPlanNum.usdExpense=( this.detailsPlanNum.usdExpense==''|| !this.detailsPlanNum.usdExpense)?0:Number( this.detailsPlanNum.usdExpense).toFixed(2)//美元费用支出
  704. this.detailsPlanNum.usdProcesscost=( this.detailsPlanNum.usdProcesscost==''|| !this.detailsPlanNum.usdProcesscost)?'':Number( this.detailsPlanNum.usdProcesscost).toFixed(2)//加工费(人民币)
  705. this.detailsPlanNum.accidentUsdamount=( this.detailsPlanNum.accidentUsdamount==''|| !this.detailsPlanNum.accidentUsdamount)?0:Number( this.detailsPlanNum.accidentUsdamount).toFixed(2)//事故单美元金额
  706. this.detailsPlanNum.salesordersLocaltotal=( this.detailsPlanNum.salesordersLocaltotal==''|| !this.detailsPlanNum.salesordersLocaltotal)?0:Number( this.detailsPlanNum.salesordersLocaltotal).toFixed(2)//销售本币金额
  707. this.detailsPlanNum.accidentcnyAmount=( this.detailsPlanNum.accidentcnyAmount==''|| !this.detailsPlanNum.accidentcnyAmount)?0:Number( this.detailsPlanNum.accidentcnyAmount).toFixed(2)//事故单人民币金额
  708. this.detailsPlanNum.salesrrdersOriginaltotal=( this.detailsPlanNum.salesrrdersOriginaltotal==''|| !this.detailsPlanNum.salesrrdersOriginaltotal)?0:Number( this.detailsPlanNum.salesrrdersOriginaltotal).toFixed(2)//销售订单原币金额
  709. this.detailsPlanNum.excipiencostIncludestaxUsd=( this.detailsPlanNum.excipiencostIncludestaxUsd==''|| !this.detailsPlanNum.excipiencostIncludestaxUsd)?0: this.detailsPlanNum.excipiencostIncludestaxUsd//辅料成本($)
  710. this.detailsPlanNum.shuiemoney=( this.detailsPlanNum.shuiemoney==''|| !this.detailsPlanNum.shuiemoney)?0: this.detailsPlanNum.shuiemoney//运费税额
  711. this.detailsPlanNum.shortvalue=( this.detailsPlanNum.shortvalue==''|| !this.detailsPlanNum.shortvalue)?'': (this.detailsPlanNum.shortvalue).toFixed(2)//短出货值
  712. this.color1 = Number(this.detailsPlanNum.rmbExportamount)-Number(this.detailsPlanNum.fabriccostNotincludestax)-Number(this.detailsPlanNum.excipiencostNotincludestax)-Number(this.detailsPlanNum.rmbProcesscost)-Number(this.detailsPlanNum.rmbExpense)
  713. this.color2 = this.color1/Number(this.detailsPlanNum.usdTotalexportprice)
  714. this.color2 = this.color2>0?this.color2:-this.color2
  715. },
  716. //计算出运明细合计行
  717. calculation(val){
  718. var shipQuantityAll =0,
  719. exportPriceAll =0,
  720. rmbAmountAll = 0,
  721. processCostAll = 0
  722. val.map(item=>{
  723. if(item.outdata !=='合计'){
  724. shipQuantityAll+=Number(item.shipQuantity)
  725. exportPriceAll+=Number(item.exportPrice)
  726. rmbAmountAll+=Number(item.rmbAmount)
  727. processCostAll+=Number(item.processCost)
  728. }
  729. })
  730. var allObj ={
  731. outdata:'合计',
  732. shipQuantity:shipQuantityAll.toFixed(3),
  733. exportPrice:exportPriceAll.toFixed(3),
  734. rmbAmount:rmbAmountAll.toFixed(3),
  735. processCost:processCostAll.toFixed(3)
  736. }
  737. //发运明细-合计行
  738. if(this.$refs.unitTabs.shipData.length!==0 ){
  739. if(this.$refs.unitTabs.shipData[this.$refs.unitTabs.shipData.length-1].outdata=='合计'){
  740. this.$refs.unitTabs.shipData.pop()
  741. }
  742. this.$refs.unitTabs.shipData.push(allObj)
  743. }
  744. this.$refs.unitTabs.shipData.map(item=>{
  745. item.shipQuantity = Number(item.shipQuantity)
  746. item.exportUnitPrice = Number(item.exportUnitPrice)
  747. item.exportPrice = Number(item.exportPrice)
  748. item.rmbAmount = Number(item.rmbAmount)
  749. item.procesUnitPricermb = Number(item.procesUnitPricermb)
  750. item.procesUnitPriceusd = Number(item.procesUnitPriceusd)
  751. item.processCost = Number(item.processCost)
  752. })
  753. },
  754. //辅料中的合计行
  755. addAmountIng(val){
  756. var
  757. transferCostAll =0,
  758. rmbAmountAll = 0,
  759. usdAmountAll = 0,
  760. priceExcludingtaxAll = 0
  761. this.$refs.unitTabs.ingData.map(item=>{
  762. if(item.goodsName!=='合计'){
  763. if((!item.usdAmount|| item.usdAmount=='')||item.rmbAmount == item.usdAmount){
  764. item.usdAmount = ((item.priceExcludingtax?Number(item.priceExcludingtax):0)/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
  765. }
  766. if(item.rmbAmount !== item.usdAmount){ usdAmountAll+=item.usdAmount?Number(item.usdAmount):0 }
  767. transferCostAll+=item.transferCost?Number(item.transferCost):0
  768. rmbAmountAll+=item.rmbAmount?Number(item.rmbAmount):0
  769. priceExcludingtaxAll+=item.priceExcludingtax?Number(item.priceExcludingtax):0
  770. }
  771. })
  772. var allObj ={
  773. goodsName:'合计',
  774. transferCost:transferCostAll,
  775. rmbAmount:rmbAmountAll,
  776. usdAmount:usdAmountAll,
  777. priceExcludingtax:priceExcludingtaxAll,
  778. ingredientsTransferQuantity:'',
  779. ingredientsRemainingQuantity:''
  780. }
  781. if(this.$refs.unitTabs.ingData.length!==0 ){
  782. if(this.$refs.unitTabs.ingData[this.$refs.unitTabs.ingData.length-1].goodsName=='合计'){this.$refs.unitTabs.ingData.pop()}
  783. this.$refs.unitTabs.ingData.push(allObj)
  784. }
  785. if(rmbAmountAll == usdAmountAll){
  786. this.detailsPlanNum.excipiencostIncludestaxUsd = 0
  787. }else{
  788. this.detailsPlanNum.excipiencostIncludestaxUsd = usdAmountAll.toFixed(2)
  789. }
  790. },
  791. //事故单合计行
  792. addAccident(val){
  793. var amountAll=0,
  794. amountrmbAll=0,
  795. pkorgAmountAll = 0,
  796. pkorgAmountrmbAll = 0
  797. val.map(item=>{
  798. if(item.accidentUndertaker!=='合计'){
  799. amountAll+=Number(item.amount)
  800. amountrmbAll+=Number(item.amountrmb)
  801. pkorgAmountAll+=item.pkorgAmount?Number(item.pkorgAmount):0
  802. pkorgAmountrmbAll+=item.pkorgAmountrmb?Number(item.pkorgAmountrmb):0
  803. }
  804. })
  805. this.detailsPlanNum.pkorgAmount = pkorgAmountAll
  806. this.detailsPlanNum.pkorgAmountrmb = pkorgAmountrmbAll
  807. var allObj={
  808. accidentUndertaker:'合计',
  809. amount:amountAll,
  810. amountrmb:amountrmbAll
  811. }
  812. if(this.accidentListData.length!==0 ){
  813. if(this.accidentListData[this.accidentListData.length-1].accidentUndertaker=='合计'){this.accidentListData.pop()}
  814. this.accidentListData.push(allObj)
  815. }
  816. },
  817. //费用支出合计行
  818. addAmountCostPay(val){
  819. var disbursedLocalmoneyALL=0,
  820. disbursedOriginalmoneyALL=0,
  821. shuiemoneyAll = 0
  822. val.map(item=>{
  823. if(item.setNo!=='合计'){
  824. disbursedLocalmoneyALL+=item.disbursedLocalmoney?Number(item.disbursedLocalmoney):0
  825. disbursedOriginalmoneyALL+=Number(item.disbursedOriginalmoney)
  826. shuiemoneyAll+=Number(item.shuiemoney)
  827. }
  828. })
  829. var obj={
  830. setNo:'合计',
  831. disbursedLocalmoney:disbursedLocalmoneyALL,
  832. disbursedOriginalmoney:disbursedOriginalmoneyALL,
  833. shuiemoney:shuiemoneyAll.toFixed(3),
  834. iNatMoney:(disbursedLocalmoneyALL+shuiemoneyAll)
  835. }
  836. if(this.costPayData.length!==0){
  837. if(this.costPayData[this.costPayData.length-1].setNo=='合计'){this.costPayData.pop()}
  838. this.costPayData.push(obj)
  839. }
  840. this.detailsPlanNum.shuiemoney = shuiemoneyAll.toFixed(2)
  841. this.detailsPlanNum.rmbNorTaxExpense = Number(obj.disbursedLocalmoney).toFixed(2)
  842. this.detailsPlanNum.rmbExpense = Number(obj.iNatMoney).toFixed(2)
  843. this.detailsPlanNum.usdExpense = (Number(this.detailsPlanNum.rmbNorTaxExpense)/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
  844. },
  845. // 附件
  846. openEnclosure(){
  847. this.$refs.attachmentDisplay.AttachmentModVis = true
  848. var attachList = [];
  849. if (this.detailsPlanNum != null && this.detailsPlanNum.accessorItemList != null){
  850. this.detailsPlanNum.accessorItemList.forEach(e=>{
  851. var attach = {};
  852. attach.name = e.filename;
  853. attach.src=e.fileurl;
  854. attachList.push(attach);
  855. });
  856. }
  857. this.$refs.attachmentDisplay.attachmentData = attachList;
  858. },
  859. //打印
  860. daYin(){
  861. this.showSelect = 1
  862. this.$nextTick(() => {
  863. const html = window.document.getElementById('costAllocationTable').innerHTML
  864. const win = window.open();
  865. const style = '<style>\n'
  866. +'.noprint{display:none}'
  867. // +'.ant-table-body-inner{overflow-x: hidden !important;overflow-y: hidden !important }' //去除滚动条
  868. +'.ant-table-body{overflow-x: hidden !important ;overflow-y: hidden !important}'
  869. +'.ant-table-header {overflow-x: hidden !important ;overflow-y: hidden !important}'
  870. +'.ant-table-fixed-left{display: none !important}'
  871. +'.ant-tabs-nav-container{display: none !important}'
  872. +'.kk{display:flex;flex-wrap: wrap}' //主要信息并排
  873. +'.ant-col-sm-8{width:40%;margin-bottom: 6px;}'
  874. +'.ant-form-item-label{width:55%;font-size: 12px;}'
  875. +'.ant-form-item-children{font-size: 12px}'
  876. +'.ant-card-head-title{font-weight: bold;font-size: 0.67em;margin-bottom: 9px;}'
  877. +'.ant-form-item-control-wrapper{width:100%}'
  878. +'.ant-input{width:100%}'
  879. +'.ant-form-item{display:flex}'
  880. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  881. + 'th,td{width:2%;height: 18px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px;text-align: center;word-wrap: break-word;}\n'
  882. +'.ant-table-row-cell-break-word{width:5% !important}'
  883. + 'th{color: #333}\n'
  884. + 'a{color: #666; text-decoration:none;}\n'
  885. +'.title{text-align: center;}'
  886. + '</style>';
  887. win.document.write(style+html);
  888. win.focus();
  889. setTimeout(function(){
  890. let textArea = win.document.getElementsByTagName('textarea')
  891. for (let i = 0; i < textArea.length; i++) {
  892. textArea[i].style.height = 'auto' // 先设置成auto,再设置高度,删除文字的时候高度才会改变
  893. textArea[i].style.height = textArea[i].scrollHeight+100 + 'px'
  894. }
  895. win.print();
  896. win.close();
  897. },500)
  898. // win.print();
  899. // win.close();
  900. this.showSelect = 0
  901. })
  902. },
  903. //该表税率
  904. changeTaxrate(){
  905. this.$refs.unitTabs.changeTaxrate(this.detailsPlanNum.taxrate)
  906. },
  907. //计算事故单美元金额和事故单人民币金额
  908. accidentCalculation(val){
  909. var usaMoney = 0,
  910. rmbMoney = 0
  911. val.map(item=>{
  912. if(item.accidentType=='应补' && item.amount!==''&&item.amount&&item.amount!=='0'&&Number(item.amount)>0){
  913. item.amount=Number(item.amount)*(-1)
  914. }else if(item.accidentType=='应补' && item.amountrmb!==''&&item.amountrmb&&item.amountrmb!=='0'&&Number(item.amount)>0){
  915. item.amountrmb = Number(item.amountrmb)*(-1)
  916. }
  917. if(item.accidentUndertaker!=='合计'){
  918. usaMoney += Number(item.amount),
  919. rmbMoney+=Number(item.amountrmb)
  920. }
  921. })
  922. this.detailsPlanNum.accidentUsdamount = usaMoney.toFixed(2)
  923. this.detailsPlanNum.accidentcnyAmount = rmbMoney.toFixed(2)
  924. },
  925. // 页面 保存
  926. save() {
  927. this.isDisabled = true
  928. setTimeout(() => {
  929. let that = this
  930. that.isDisabled = false
  931. }, 3000)
  932. var halfInfo = {}
  933. var json = Object.assign({},this.detailsPlanNum)
  934. json.fabriccostIncludestax = this.fabricCost
  935. json.outdata=moment(json.outdata).format('YYYY-MM-DD hh:mm:ss')
  936. json.signNumA = this.color1
  937. json.signNumB = this.color2
  938. this.loading=true
  939. addHalfInfo(json).then(res => {
  940. this.isDisabled = false
  941. this.loading=false
  942. if (res.success) {
  943. console.log('保存的部分信息', halfInfo)
  944. this.$message.success('保存成功')
  945. halfInfo = {}
  946. }else{
  947. this.$message.error(res.message);
  948. }
  949. })
  950. },
  951. // 主表:人民币费用支出 弹框
  952. mainTableExpenseCNY() {
  953. console.log('点击:主表人民币费用支出')
  954. this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYModVis = true
  955. this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYData = this.costPayData
  956. this.$refs.mainTableExpenseCNYModal.fixedData = this.costPayData
  957. },
  958. // 主表:美元费用支出 弹框
  959. mainTableExpenseUSD() {
  960. console.log('点击:主表美元费用支出')
  961. this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDModVis = true
  962. this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDData = this.costPayData
  963. this.$refs.mainTableExpenseUSDModal.fixedData = this.costPayData
  964. },
  965. orderDataChange(data){
  966. this.detailsPlanNum.queryTime = moment(data).format('yyyy-MM-DD')
  967. },
  968. // 事故单 单号 弹框
  969. accidentListCustomCell(record) {
  970. return {
  971. on: {
  972. click: event => {
  973. // this.$router.push({path:'http://localhost:3000/#/IncidentTicketModalDetail'})
  974. // console.log('this:', this)
  975. // // 调用【面料损耗表】中的【事故单】弹框
  976. // this.$refs.accidentListModal.accidentListModVis = true
  977. // this.$refs.accidentListModal.accidentList = record
  978. }
  979. }
  980. }
  981. },
  982. number(data1,data2){
  983. this.detailsPlanNum.fabriccostNotincludestax = data1
  984. // this.detailsPlanNum.excipiencostNotincludestax = data2
  985. },
  986. FabInQua(data,allYu){
  987. this.detailsPlanNum.fabriccostIncludestax=(Number(data)+Number(this.fabricCost)-Number(allYu)).toFixed(2)//面料含税成本
  988. // this.detailsPlanNum.fabriccostIncludestax=(Number(this.fabricCost)-Number(allYu)).toFixed(2)//面料含税成本
  989. this.detailsPlanNum.fabriccostIncludestaxUsd = (Number(this.detailsPlanNum.fabriccostIncludestax)/1.13/this.detailsPlanNum.exchangeRate).toFixed(2)//表头面料成本($)
  990. this.detailsPlanNum.fabriccostNotincludestax = (Number(this.detailsPlanNum.fabriccostIncludestax)/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)
  991. this.$refs.unitTabs.sumInfo.fabricAmount=this.detailsPlanNum.fabriccostIncludestax
  992. this.$refs.unitTabs.sumInfo.fabricExcludTax =(this.detailsPlanNum.fabriccostNotincludestax!==''&&this.detailsPlanNum.fabriccostNotincludestax)?(Number(this.detailsPlanNum.fabriccostNotincludestax)).toFixed(2):''//合计中的不含税面料总额
  993. this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
  994. },
  995. // father 方法
  996. aa() {},
  997. bb() {},
  998. cc() {}
  999. },
  1000. computed: {
  1001. importExcelUrl: function() {
  1002. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  1003. },
  1004. },
  1005. mounted() {}
  1006. }
  1007. </script>
  1008. <style lang="less" scoped>
  1009. @import '~@assets/less/common.less';
  1010. @import '~@assets/less/overwriter.less';
  1011. /deep/ .ant-table-thead > tr > th {
  1012. text-align: center;
  1013. // font-weight: 700;
  1014. }
  1015. /deep/ .ant-table-tbody {
  1016. text-align: center;
  1017. }
  1018. /deep/ .fontColor .ant-form-item-label > label{
  1019. color: red !important;
  1020. }
  1021. // /deep/ th.replacecolor {
  1022. // background-color: #ccc;
  1023. // }
  1024. // 抽屉里的card样式
  1025. // /deep/ .ant-drawer-content {
  1026. // background-color: #f0f2f5;
  1027. // }
  1028. // /deep/ .ant-drawer-body {
  1029. // padding: 10px;
  1030. // }
  1031. /deep/ form :not(.ant-input-group-wrapper) > .ant-input-group, form .ant-input-group-wrapper{
  1032. width: 65% !important;
  1033. }
  1034. /deep/ .ant-input-group{
  1035. padding-right: 6px !important;
  1036. }
  1037. .taxrate{
  1038. width: 40%;
  1039. }
  1040. .title{
  1041. display: none;
  1042. }
  1043. </style>