costDetailDrawer.vue 50 KB

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