costDetailDrawer.vue 48 KB

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