costDetailDrawer.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  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-form-model>
  246. </div>
  247. </a-row>
  248. </a-card>
  249. <!--tabs 组件引入 -->
  250. <a-card :bordered="true" style=" marginTop:10px;">
  251. <div><tabs ref="unitTabs" :showSelect='showSelect' @number="number" :showAll="showAll"/></div>
  252. </a-card>
  253. <!-- 事故单 -->
  254. <a-card :bordered="true" style="margin:10px 0">
  255. <div style="margin:60px 0 40px 0" :class="[(accidentListData.length==0?'noprint': '')]">
  256. <h6 class="table-title">事故单</h6>
  257. <a-table
  258. rowKey="id"
  259. :loading="loading"
  260. :columns="accidentListColumns"
  261. :data-source="accidentListData"
  262. bordered
  263. :pagination="false"
  264. :scroll="{ }"
  265. >
  266. <!-- 事故单 -->
  267. <span slot="accidentNum" slot-scope="text,record">
  268. <a :href="'http://www.myfitt.cn:18086/#/IncidentTicketModalDetail?id='+record.id" target="_blank">{{ text }}</a>
  269. </span>
  270. </a-table>
  271. </div>
  272. <!-- 费用支出 -->
  273. <div :class="[(costPayData.length==0?'noprint': '')]">
  274. <h6 class="table-title" >费用支出</h6>
  275. <a-table
  276. rowKey="id"
  277. :loading="loading"
  278. :columns="costPayColumns"
  279. :data-source="costPayData"
  280. bordered
  281. :pagination="false"
  282. >
  283. </a-table>
  284. </div>
  285. <!-- 备注信息 根据角色权限控制【填写】、【查看】-->
  286. <div class="note-one" style="marginTop:40px;">
  287. <h6 class="table-title">备注</h6>
  288. <div class="noteDetail">
  289. <a-form-model ref="form" :model="detailsPlanNum">
  290. <a-form-model-item prop="remarks">
  291. <a-input type="textarea" v-model="detailsPlanNum.remarks" placeholder="请输入备注" style="minHeight:100px;" v-show='showSelect==0' />
  292. <a-input type="textarea" v-text="detailsPlanNum.remarks" style="minHeight:100px;" v-show='showSelect==1'/>
  293. </a-form-model-item>
  294. </a-form-model>
  295. </div>
  296. </div>
  297. <!-- 页面底部保存 -->
  298. <!-- <a-row :gutter="24" style="marginTop:40px;float:right" class="noprint">
  299. <a-col :md="12" :sm="12" style="display:flex">
  300. <a-button type="primary" @click="daYin" style="margin-right:6px" :disabled ="PrintButton">
  301. 打印
  302. </a-button>
  303. <a-button type="primary" @click="save" :disabled="isDisabled">
  304. 保存
  305. </a-button>
  306. </a-col> -->
  307. <!-- </a-row> -->
  308. </a-card>
  309. <!-- 弹框 -->
  310. <div>
  311. <!-- 主表 人民币费用支出 弹框 -->
  312. <mainTableExpenseCNY-modal ref="mainTableExpenseCNYModal" :father="aa"></mainTableExpenseCNY-modal>
  313. <!-- 主表 美元费用支出 弹框 -->
  314. <mainTableExpenseUSD-modal ref="mainTableExpenseUSDModal" :father="bb"></mainTableExpenseUSD-modal>
  315. <!-- 事故单 -->
  316. <accidentList-modal ref="accidentListModal" :father="cc"></accidentList-modal>
  317. <!-- 提交信息 -->
  318. <Csubmit-information ref="CsubmitInformation" @close="closeInformation"></Csubmit-information>
  319. <!-- 选择指派人员 -->
  320. <select-user-modal ref="SelectUserModal" @selectFinished="selectFinished"></select-user-modal>
  321. </div>
  322. </div>
  323. </a-modal>
  324. </template>
  325. <script>
  326. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  327. import JEllipsis from '@/components/jeecg/JEllipsis'
  328. import moment from 'moment'
  329. // 原始文件(应该跟单证内弹框一样,尝试公用,成功后可删除以下注释)
  330. // import mainTableExpenseCNYModal from '@views/reportForms/cost-allocation-table/mainTableExpenseCNYModal.vue'
  331. // import mainTableExpenseUSDModal from '@views/reportForms/cost-allocation-table/mainTableExpenseUSDModal.vue'
  332. // import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue' // 事故单
  333. // import tabs from '@views/cost-allocation-total/tabs.vue' // tabs组件
  334. import tabs from '@views/reportForms/cost-allocation-table/tabs.vue' // tabs组件
  335. import CsubmitInformation from '@views/cost-allocation-total/modal/CsubmitInformation.vue'
  336. import mainTableExpenseCNYModal from '@views/cost-allocation-total/modal/mainTableExpenseCNYModal.vue'
  337. import mainTableExpenseUSDModal from '@views/cost-allocation-total/modal/mainTableExpenseUSDModal.vue'
  338. import accidentListModal from '@views/cost-allocation-total/modal/accidentListModal.vue' // 事故单
  339. import SelectUserModal from '@views/cost-allocation-total/modal/SelectUserModal.vue'
  340. import { USER_AUTH } from "@/store/mutation-types"
  341. import { seachPlanNum, addHalfInfo,deleteFileDetail,assignedData,cancelSubmit } from '@api/document/cost-allocation-total.js'
  342. export default {
  343. name: 'CostAllocationTable', // 成本分配 (新增)
  344. mixins: [JeecgListMixin],
  345. components: { JEllipsis,SelectUserModal,CsubmitInformation, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal },
  346. data() {
  347. return {
  348. key: '', //客户输入的订单号
  349. PrintButton:true,//打印按钮
  350. showSelect:0,//计划号是否是输入框
  351. loading: false, // 表格加载
  352. showAll:'yes',
  353. detailsPlanNum: {
  354. planNum: ''
  355. }, // 详情所有数据
  356. remarks: '', // 备注
  357. // 事故单 表头
  358. accidentListColumns: [
  359. {
  360. title: '单号',
  361. width: 120,
  362. dataIndex: 'accidentNumber',
  363. className: 'replacecolor',
  364. customCell: this.accidentListCustomCell,
  365. scopedSlots: { customRender: 'accidentNum' }
  366. },
  367. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  368. {
  369. title: '美元金额',
  370. width: 120,
  371. dataIndex: 'amount',
  372. className: 'replacecolor' ,
  373. customRender: (text, record, index) => {
  374. if(text!==''&&text){
  375. return Number(text).toFixed(2)
  376. }
  377. },
  378. },
  379. {
  380. title: '人民币金额',
  381. width: 120,
  382. dataIndex: 'amountrmb',
  383. className: 'replacecolor' ,
  384. customRender: (text, record, index) => {
  385. if(text!==''&&text){
  386. return Number(text).toFixed(2)
  387. }
  388. },
  389. },
  390. { title: '事故单主题', width: 120, dataIndex: 'accidentTheme', className: 'replacecolor' },
  391. { title: '责任人', width: 120, dataIndex: 'responsibilityPerson1', className: 'replacecolor' },
  392. // { title: '币种', width: 120, dataIndex: 'moneyType', className: 'replacecolor' },
  393. // { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
  394. ],
  395. accidentListData: [],
  396. // 费用支出 表头
  397. costPayColumns: [
  398. { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
  399. { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo', className: 'replacecolor' },
  400. { title: '费用项目', dataIndex: 'expenseItem', width: 120, className: 'replacecolor' },
  401. {
  402. title: '美元',
  403. dataIndex: 'disbursedOriginalmoney',
  404. width: 120,
  405. className: 'replacecolor' ,
  406. customRender: (text, record, index) => {
  407. if(text!==''&&text){
  408. return Number(text).toFixed(2)
  409. }
  410. },
  411. },
  412. {
  413. title: '人民币(不含税)',
  414. dataIndex: 'disbursedLocalmoney',
  415. width: 120, 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: 'shuiemoney',
  425. width: 120,
  426. 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: 'iNatMoney',
  436. width: 120,
  437. className: 'replacecolor',
  438. customRender: (text, record, index) => {
  439. if(text!==''&&text){
  440. return Number(text).toFixed(2)
  441. }
  442. }, },
  443. { title: '发票号', dataIndex: 'invoicenum', width: 120, className: 'replacecolor' },
  444. { title: '制单人', dataIndex: 'preparedBy', width: 120, className: 'replacecolor' }
  445. ],
  446. costPayData: [],
  447. detailModVis:false,
  448. planNo:'',
  449. isDisabled: false, //按钮禁止
  450. billstatus: '', // 单据状态
  451. status:'',
  452. color1:0,
  453. color2:0,
  454. fileList:[],
  455. AssignedPerson:'no',
  456. AssignedPersonQx:'no',
  457. authority:'no',
  458. url: {
  459. list: '/sys/user/list',
  460. importExcelUrl: 'cost/syCostAllocation/addFile' ,// 导入
  461. }
  462. // dateFormat: 'YYYY-MM-DD',
  463. }
  464. },
  465. created() {},
  466. filters: {
  467. //文字数超出时,超出部分使用...
  468. ellipsis(value) {
  469. if (!value) return ''
  470. if (value.length > 20) {
  471. return value.slice(0, 20) + '...'
  472. }
  473. return value
  474. }
  475. },
  476. methods: {
  477. // 【计划单号】 搜索
  478. onSearch() {
  479. // TODO:接口完善后,type 应改为 add(暂时为了回显数据)
  480. this.loading = true
  481. seachPlanNum({ plannum: this.planNo, type: 'query' }).then(res => {
  482. if (res.success) {
  483. this.PrintButton = false
  484. this.loading = false
  485. this.detailsPlanNum = res.result //所有详情
  486. if(Number(this.detailsPlanNum.shortseveral)<0){
  487. this.detailsPlanNum.shortseveral = 0
  488. this.detailsPlanNum.shortvalue = 0
  489. }
  490. // var fileList = (this.detailsPlanNum.attachs!==''&&this.detailsPlanNum.attachs)?this.detailsPlanNum.attachs.split(","):[]
  491. // this.fileList = []
  492. // if(fileList.length!==0){
  493. // fileList.map(item=>{
  494. // this.fileList.push({
  495. // uid: '-1',
  496. // name: item,
  497. // status: 'done',
  498. // url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+item
  499. // })
  500. // })
  501. // }
  502. //调整表头格式
  503. this.adjustingHeader()
  504. // this.accidentListData = res.result.syCostAllocationAccidentList //事故单
  505. // this.accidentCalculation(this.accidentListData)
  506. // var accidentNum = 0
  507. // this.accidentListData.map(item =>{
  508. // item.id = accidentNum + 1
  509. // accidentNum += 1
  510. // })
  511. this.accidentListData = res.result.syCostAllocationAccidentList //事故单
  512. this.accidentCalculation(this.accidentListData) //计算事故单美元金额和事故单人民币金额
  513. this.costPayData = res.result.syCostAllocationCostpayList //支出费用
  514. var num = 0
  515. this.costPayData.map(item =>{
  516. item.id = num + 1
  517. num += 1
  518. })
  519. // tabs 名称集合
  520. this.$refs.unitTabs.tabNameList = res.result.processUnit.split(',')
  521. //所有tabs数据
  522. this.$refs.unitTabs.tabsAllData = res.result.processUnitList
  523. // 页面打开加载的数据
  524. var oneData = this.$refs.unitTabs.tabsAllData[0]
  525. this.$refs.unitTabs.fabData = oneData.syCostAllocationFabricList
  526. var all = 0,//面料sheet-转入成本总计
  527. allYu = 0//面料sheet-余下数量成本总计
  528. this.$refs.unitTabs.fabData.map(item=>{
  529. if(item.remainingQuantitycost!=='' && item.remainingQuantitycost){
  530. item.remainingQuantitycost = item.remainingQuantitycost.toFixed(2)
  531. allYu +=Number(item.remainingQuantitycost)
  532. }
  533. if(item.transferCost&&item.transferCost!==''){
  534. all+=Number(item.transferCost)
  535. }
  536. })
  537. this.fabricCost = this.detailsPlanNum.fabriccostIncludestax
  538. this.detailsPlanNum.fabriccostIncludestax = (all+Number(this.detailsPlanNum.fabriccostIncludestax)-allYu).toFixed(2) // 表头面料成本(¥)
  539. this.detailsPlanNum.fabriccostIncludestaxUsd = (Number(this.detailsPlanNum.fabriccostIncludestax)/1.13/this.detailsPlanNum.exchangeRate).toFixed(2)//表头面料成本($)
  540. this.detailsPlanNum.fabriccostNotincludestax = (Number(this.detailsPlanNum.fabriccostIncludestax)/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)//表头-面料不含税成本(¥)
  541. this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList //辅料sheet数据源
  542. this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetail //发运明细sheet数据源
  543. this.detailsPlanNum.outdata = oneData.syCostAllocationShipdetail.length!==0?oneData.syCostAllocationShipdetail[0].outdata:'' //表头-出运日期
  544. this.addAmountIng(oneData.syCostAllocationIngredientList) //辅料sheet合计行
  545. this.addAmountCostPay(this.costPayData) //费用支出合计行
  546. this.addAccident(this.accidentListData)//事故单合计行
  547. this.calculation(oneData.syCostAllocationShipdetail) //出运明细合计行
  548. //合计中面料相关金额
  549. var s=0
  550. oneData.syCostAllocationFabricList.map(item=>{
  551. s+=Number(item.transferCost)
  552. })
  553. this.$refs.unitTabs.sumInfo.fabricAmount = (this.detailsPlanNum.fabriccostIncludestax!==''&&this.detailsPlanNum.fabriccostIncludestax)?(Number(this.detailsPlanNum.fabriccostIncludestax)).toFixed(2):'' //合计中的面料总额
  554. this.$refs.unitTabs.sumInfo.fabricExcludTax =(this.detailsPlanNum.fabriccostNotincludestax!==''&&this.detailsPlanNum.fabriccostNotincludestax)?(Number(this.detailsPlanNum.fabriccostNotincludestax)).toFixed(2):''//合计中的不含税面料总额
  555. //合计中辅料相关金额
  556. var s = 0,
  557. v =0,
  558. t=0
  559. oneData.syCostAllocationIngredientList.map(item=>{
  560. s+=item.priceExcludingtax?Number(item.priceExcludingtax):0,
  561. v+=item.rmbAmount?Number(item.rmbAmount):0
  562. t+=item.transferCost?Number(item.transferCost):0
  563. })
  564. this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
  565. this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
  566. this.detailsPlanNum.excipiencostNotincludestax = ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本
  567. this.detailsPlanNum.excipiencostIncludestax = ( this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
  568. //合计中出运明细相关金额
  569. var s =0,
  570. v = 0,
  571. d = 0,
  572. b = 0,
  573. f=0,
  574. e=0
  575. oneData.syCostAllocationShipdetail.map(item=>{
  576. s+=Number(item.exportPrice)
  577. v+=Number(item.shipQuantity)
  578. d+=Number(item.processCost)
  579. b+=Number(item.rmbAmount)
  580. if(item.outdata!=='合计'){
  581. e+=Number(item.processCostUsd)
  582. }
  583. })
  584. this.$refs.unitTabs.sumInfo.exportPriceUSD = (s/2).toFixed(2)//出运美元外销总价
  585. this.detailsPlanNum.usdTotalexportprice = this.$refs.unitTabs.sumInfo.exportPriceUSD //表头-外销总价($)
  586. this.$refs.unitTabs.sumInfo.shipQua =(v/2).toFixed(4)//出货数量合计
  587. this.$refs.unitTabs.sumInfo.shipProcesFees =(d/2).toFixed(2)//出运加工费
  588. this.$refs.unitTabs.sumInfo.exportedAmountRMB =(b/2).toFixed(2)//出运人民币外销金额 f
  589. this.detailsPlanNum.rmbExportamount = this.$refs.unitTabs.sumInfo.exportedAmountRMB //表头-外销总价(¥)
  590. //调整表头格式
  591. this.adjustingHeader()
  592. if(Number(oneData.syCostAllocationShipdetail[0].procesUnitPriceusd)>0){
  593. this.$refs.unitTabs.sumInfo.excludingTaxProcessing =this.$refs.unitTabs.sumInfo.shipProcesFees//出运不含税加工费-合计信息
  594. }else{
  595. this.$refs.unitTabs.sumInfo.excludingTaxProcessing =( this.$refs.unitTabs.sumInfo.shipProcesFees/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)//出运不含税加工费
  596. }
  597. this.detailsPlanNum.rmbProcesscost = this.$refs.unitTabs.sumInfo.excludingTaxProcessing //表头-加工费人民币
  598. f= Number(this.$refs.unitTabs.sumInfo.excludingTaxProcessing)/Number(this.detailsPlanNum.exchangeRate)
  599. this.detailsPlanNum.usdProcesscost =e==0?(Number(this.detailsPlanNum.rmbProcesscost)/Number(this.detailsPlanNum.exchangeRate)).toFixed(2):e.toFixed(2)//表头-加工费美元
  600. f=Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number(this.$refs.unitTabs.sumInfo.shipProcesFees)
  601. 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)//合计金额
  602. this.pagination = {
  603. total: res.result.total,
  604. current: res.result.current,
  605. pageSize: res.result.size
  606. }
  607. this.determineAssignedPerson()
  608. }else {
  609. this.loading = false
  610. this.$message.error(res.message);
  611. }
  612. })
  613. },
  614. //调整表头格式
  615. adjustingHeader(){
  616. this.detailsPlanNum.planQuantity=( this.detailsPlanNum.planQuantity==''|| !this.detailsPlanNum.planQuantity)?0:Number( this.detailsPlanNum.planQuantity).toFixed(0)//计划数量
  617. this.detailsPlanNum.usdTotalexportprice=( this.detailsPlanNum.usdTotalexportprice==''|| !this.detailsPlanNum.usdTotalexportprice)?0:Number( this.detailsPlanNum.usdTotalexportprice).toFixed(2)//美元外销总价
  618. this.detailsPlanNum.actualShipquantity=( this.detailsPlanNum.actualShipquantity==''|| !this.detailsPlanNum.actualShipquantity)?0:Number( this.detailsPlanNum.actualShipquantity).toFixed(0)//实际出库数量
  619. this.detailsPlanNum.rmbExportamount=( this.detailsPlanNum.rmbExportamount==''|| !this.detailsPlanNum.rmbExportamount)?0:Number( this.detailsPlanNum.rmbExportamount).toFixed(2)//人民币外销金额
  620. this.detailsPlanNum.usdExpense=( this.detailsPlanNum.usdExpense==''|| !this.detailsPlanNum.usdExpense)?0:Number( this.detailsPlanNum.usdExpense).toFixed(2)//美元费用支出
  621. this.detailsPlanNum.usdProcesscost=( this.detailsPlanNum.usdProcesscost==''|| !this.detailsPlanNum.usdProcesscost)?'':Number( this.detailsPlanNum.usdProcesscost).toFixed(2)//加工费(人民币)
  622. this.detailsPlanNum.accidentUsdamount=( this.detailsPlanNum.accidentUsdamount==''|| !this.detailsPlanNum.accidentUsdamount)?0:Number( this.detailsPlanNum.accidentUsdamount).toFixed(2)//事故单美元金额
  623. this.detailsPlanNum.salesordersLocaltotal=( this.detailsPlanNum.salesordersLocaltotal==''|| !this.detailsPlanNum.salesordersLocaltotal)?0:Number( this.detailsPlanNum.salesordersLocaltotal).toFixed(2)//销售本币金额
  624. this.detailsPlanNum.accidentcnyAmount=( this.detailsPlanNum.accidentcnyAmount==''|| !this.detailsPlanNum.accidentcnyAmount)?0:Number( this.detailsPlanNum.accidentcnyAmount).toFixed(2)//事故单人民币金额
  625. this.detailsPlanNum.salesrrdersOriginaltotal=( this.detailsPlanNum.salesrrdersOriginaltotal==''|| !this.detailsPlanNum.salesrrdersOriginaltotal)?0:Number( this.detailsPlanNum.salesrrdersOriginaltotal).toFixed(2)//销售订单原币金额
  626. this.detailsPlanNum.excipiencostIncludestaxUsd=( this.detailsPlanNum.excipiencostIncludestaxUsd==''|| !this.detailsPlanNum.excipiencostIncludestaxUsd)?0: this.detailsPlanNum.excipiencostIncludestaxUsd//辅料成本($)
  627. this.detailsPlanNum.shuiemoney=( this.detailsPlanNum.shuiemoney==''|| !this.detailsPlanNum.shuiemoney)?0: this.detailsPlanNum.shuiemoney//运费税额
  628. this.color1 = Number(this.detailsPlanNum.rmbExportamount)-Number(this.detailsPlanNum.fabriccostNotincludestax)-Number(this.detailsPlanNum.excipiencostNotincludestax)-Number(this.detailsPlanNum.rmbProcesscost)-Number(this.detailsPlanNum.rmbExpense)
  629. this.color2 = this.color1/Number(this.detailsPlanNum.usdTotalexportprice)
  630. this.color2 = this.color2>0?this.color2:-this.color2
  631. },
  632. //判断有无指派人
  633. determineAssignedPerson(){
  634. this.AssignedPerson='no'
  635. this.authority='no'
  636. this.AssignedPersonQx='no'
  637. assignedData({code:this.planNo}).then(res => {
  638. if (res.success) {
  639. var array = res.result!==''?res.result.split(","):[]
  640. if(array.length!==0){
  641. this.AssignedPerson='yes'
  642. }
  643. let allAuthes = JSON.parse(sessionStorage.getItem(USER_AUTH));
  644. var quanXian = []
  645. allAuthes.map(item=>{ quanXian.push(item.action)})
  646. if(quanXian.indexOf('zpqx:kj2')!==-1){
  647. this.authority = 'yes'
  648. }
  649. array.every(item=>{
  650. if(item==this.$store.getters.userInfo.realname){
  651. this.AssignedPersonQx='yes'
  652. return false
  653. }
  654. return true
  655. })
  656. }else{
  657. this.$message.error(res.message);
  658. }
  659. })
  660. },
  661. //提交
  662. Submit(){
  663. this.$refs.CsubmitInformation.submitInformationModVis = true
  664. this.$refs.CsubmitInformation.text = '提交'
  665. },
  666. closeInformation(data,text){
  667. var syApprovalHistory={
  668. stuta:text=='提交'?'提交':'驳回',
  669. planNo:this.planNo,
  670. processingOpinion:data,
  671. processedBy:this.$store.getters.userInfo.realname,
  672. processingTime:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  673. assignedBy:''
  674. }
  675. cancelSubmit({planNum:this.planNo,status:this.status,currentState:text=='提交'?'提交':'驳回',syApprovalHistory:syApprovalHistory}).then(res => {
  676. if (res.success) {
  677. this.$message.success(text+'成功')
  678. this.handlecLose()
  679. this.$emit('close')
  680. this.determineAssignedPerson()
  681. }else{
  682. this.$message.error(res.message);
  683. }
  684. })
  685. },
  686. Approved(){
  687. var syApprovalHistory={
  688. stuta:'审批通过',
  689. planNo:this.planNo,
  690. processingOpinion:'',
  691. processedBy:this.$store.getters.userInfo.realname,
  692. processingTime:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  693. assignedBy:''
  694. }
  695. cancelSubmit({planNum:this.planNo,status:this.status,currentState:'审批通过',syApprovalHistory:syApprovalHistory}).then(res => {
  696. if (res.success) {
  697. this.$message.success('审批通过')
  698. this.handlecLose()
  699. this.$emit('close')
  700. this.determineAssignedPerson()
  701. }else{
  702. this.$message.error(res.message);
  703. }
  704. })
  705. },
  706. assign(){
  707. this.$refs.SelectUserModal.visible = true
  708. },
  709. selectFinished(data){
  710. var syApprovalHistory={
  711. stuta:'指派',
  712. planNo:this.planNo,
  713. processingOpinion:'',
  714. processedBy:this.$store.getters.userInfo.realname,
  715. processingTime:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  716. assignedBy:data
  717. }
  718. cancelSubmit({planNum:this.planNo,status:this.status,currentState:'指派',syApprovalHistory:syApprovalHistory}).then(res => {
  719. if (res.success) {
  720. this.$message.success('指派成功')
  721. this.handlecLose()
  722. this.$emit('close')
  723. this.determineAssignedPerson()
  724. }else{
  725. this.$message.error(res.message);
  726. }
  727. })
  728. },
  729. reject(){
  730. this.$refs.CsubmitInformation.submitInformationModVis = true
  731. this.$refs.CsubmitInformation.text = '返单'
  732. },
  733. revokeApproval(){
  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:''
  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.AssignedPerson='yes'
  748. }else{
  749. this.$message.error(res.message);
  750. }
  751. })
  752. },
  753. //计算出运明细合计行
  754. calculation(val){
  755. var shipQuantityAll =0,
  756. exportPriceAll =0,
  757. rmbAmountAll = 0,
  758. processCostAll = 0
  759. val.map(item=>{
  760. if(item.outdata !=='合计'){
  761. shipQuantityAll+=Number(item.shipQuantity)
  762. exportPriceAll+=Number(item.exportPrice)
  763. rmbAmountAll+=Number(item.rmbAmount)
  764. processCostAll+=Number(item.processCost)
  765. }
  766. })
  767. var allObj ={
  768. outdata:'合计',
  769. shipQuantity:shipQuantityAll.toFixed(3),
  770. exportPrice:exportPriceAll.toFixed(3),
  771. rmbAmount:rmbAmountAll.toFixed(3),
  772. processCost:processCostAll.toFixed(3)
  773. }
  774. //发运明细-合计行
  775. if(this.$refs.unitTabs.shipData.length!==0 ){
  776. if(this.$refs.unitTabs.shipData[this.$refs.unitTabs.shipData.length-1].outdata=='合计'){
  777. this.$refs.unitTabs.shipData.pop()
  778. }
  779. this.$refs.unitTabs.shipData.push(allObj)
  780. }
  781. this.$refs.unitTabs.shipData.map(item=>{
  782. item.shipQuantity = Number(item.shipQuantity)
  783. item.exportUnitPrice = Number(item.exportUnitPrice)
  784. item.exportPrice = Number(item.exportPrice)
  785. item.rmbAmount = Number(item.rmbAmount)
  786. item.procesUnitPricermb = Number(item.procesUnitPricermb)
  787. item.procesUnitPriceusd = Number(item.procesUnitPriceusd)
  788. item.processCost = Number(item.processCost)
  789. })
  790. },
  791. //辅料中的合计行
  792. addAmountIng(val){
  793. var
  794. transferCostAll =0,
  795. rmbAmountAll = 0,
  796. usdAmountAll = 0,
  797. priceExcludingtaxAll = 0
  798. this.$refs.unitTabs.ingData.map(item=>{
  799. if(item.goodsName!=='合计'){
  800. item.usdAmount = ((item.priceExcludingtax?Number(item.priceExcludingtax):0)/this.detailsPlanNum.exchangeRate)
  801. if(item.rmbAmount !== item.usdAmount){ usdAmountAll+=item.usdAmount?Number(item.usdAmount):0 }
  802. transferCostAll+=item.transferCostAll?Number(item.transferCost):0
  803. rmbAmountAll+=item.rmbAmount?Number(item.rmbAmount):0
  804. priceExcludingtaxAll+=item.priceExcludingtax?Number(item.priceExcludingtax):0
  805. }
  806. })
  807. var allObj ={
  808. goodsName:'合计',
  809. transferCost:transferCostAll,
  810. rmbAmount:rmbAmountAll,
  811. usdAmount:usdAmountAll,
  812. priceExcludingtax:priceExcludingtaxAll,
  813. ingredientsTransferQuantity:'',
  814. ingredientsRemainingQuantity:''
  815. }
  816. if(this.$refs.unitTabs.ingData.length!==0 ){
  817. if(this.$refs.unitTabs.ingData[this.$refs.unitTabs.ingData.length-1].goodsName=='合计'){this.$refs.unitTabs.ingData.pop()}
  818. this.$refs.unitTabs.ingData.push(allObj)
  819. }
  820. if(rmbAmountAll == usdAmountAll){
  821. this.detailsPlanNum.excipiencostIncludestaxUsd = 0
  822. }else{
  823. this.detailsPlanNum.excipiencostIncludestaxUsd = usdAmountAll.toFixed(2)
  824. }
  825. },
  826. //事故单合计行
  827. addAccident(val){
  828. var amountAll=0,
  829. amountrmbAll=0
  830. val.map(item=>{
  831. if(item.accidentUndertaker!=='合计'){
  832. amountAll+=Number(item.amount)
  833. amountrmbAll+=Number(item.amountrmb)
  834. }
  835. })
  836. var allObj={
  837. accidentUndertaker:'合计',
  838. amount:amountAll,
  839. amountrmb:amountrmbAll
  840. }
  841. if(this.accidentListData.length!==0 ){
  842. if(this.accidentListData[this.accidentListData.length-1].accidentUndertaker=='合计'){this.accidentListData.pop()}
  843. this.accidentListData.push(allObj)
  844. }
  845. },
  846. //费用支出合计行
  847. addAmountCostPay(val){
  848. var disbursedLocalmoneyALL=0,
  849. disbursedOriginalmoneyALL=0,
  850. shuiemoneyAll = 0
  851. val.map(item=>{
  852. if(item.setNo!=='合计'){
  853. disbursedLocalmoneyALL+=item.disbursedLocalmoney?Number(item.disbursedLocalmoney):0
  854. disbursedOriginalmoneyALL+=Number(item.disbursedOriginalmoney)
  855. shuiemoneyAll+=Number(item.shuiemoney)
  856. }
  857. })
  858. var obj={
  859. setNo:'合计',
  860. disbursedLocalmoney:disbursedLocalmoneyALL,
  861. disbursedOriginalmoney:disbursedOriginalmoneyALL,
  862. shuiemoney:shuiemoneyAll.toFixed(3),
  863. iNatMoney:(disbursedLocalmoneyALL+shuiemoneyAll)
  864. }
  865. if(this.costPayData.length!==0){
  866. if(this.costPayData[this.costPayData.length-1].setNo=='合计'){this.costPayData.pop()}
  867. this.costPayData.push(obj)
  868. }
  869. this.detailsPlanNum.shuiemoney = shuiemoneyAll.toFixed(3)
  870. this.detailsPlanNum.rmbNorTaxExpense = Number(obj.disbursedLocalmoney).toFixed(2)
  871. this.detailsPlanNum.rmbExpense = Number(obj.iNatMoney).toFixed(2)
  872. this.detailsPlanNum.usdExpense = (Number(this.detailsPlanNum.rmbNorTaxExpense)/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
  873. },
  874. daYin(){
  875. this.showSelect = 1
  876. this.$nextTick(() => {
  877. const html = window.document.getElementById('costAllocationTable').innerHTML
  878. const win = window.open();
  879. const style = '<style>\n'
  880. +'.noprint{display:none}'
  881. // +'.ant-table-body-inner{overflow-x: hidden !important;overflow-y: hidden !important }' //去除滚动条
  882. +'.ant-table-body{overflow-x: hidden !important ;overflow-y: hidden !important}'
  883. +'.ant-table-header {overflow-x: hidden !important ;overflow-y: hidden !important}'
  884. +'.ant-table-fixed-left{display: none !important}'
  885. +'.ant-tabs-nav-container{display: none !important}'
  886. +'.kk{display:flex;flex-wrap: wrap}' //主要信息并排
  887. +'.ant-col-sm-8{width:40%;margin-bottom: 6px;}'
  888. +'.ant-form-item-label{width:55%;font-size: 12px;}'
  889. +'.ant-form-item-children{font-size: 12px}'
  890. +'.ant-card-head-title{font-weight: bold;font-size: 0.67em;margin-bottom: 9px;}'
  891. +'.ant-form-item-control-wrapper{width:100%}'
  892. +'.ant-input{width:100%}'
  893. +'.ant-form-item{display:flex}'
  894. + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
  895. + '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'
  896. +'.ant-table-row-cell-break-word{width:5% !important}'
  897. + 'th{color: #333}\n'
  898. + 'a{color: #666; text-decoration:none;}\n'
  899. + '</style>';
  900. win.document.write(style+html);
  901. win.focus();
  902. win.print();
  903. win.close();
  904. this.showSelect = 0
  905. })
  906. },
  907. //该表税率
  908. changeTaxrate(){
  909. this.$refs.unitTabs.changeTaxrate(this.detailsPlanNum.taxrate)
  910. },
  911. //计算事故单美元金额和事故单人民币金额
  912. accidentCalculation(val){
  913. var usaMoney = 0,
  914. rmbMoney = 0
  915. val.map(item=>{
  916. if(item.accidentType=='应补' && item.amount!==''&&item.amount&&item.amount!=='0'){
  917. item.amount=Number(item.amount)*(-1)
  918. }else if(item.accidentType=='应补' && item.amountrmb!==''&&item.amountrmb&&item.amountrmb!=='0'){
  919. item.amountrmb = Number(item.amountrmb)*(-1)
  920. }
  921. usaMoney += Number(item.amount),
  922. rmbMoney+=Number(item.amountrmb)
  923. })
  924. this.detailsPlanNum.accidentUsdamount = usaMoney.toFixed(2)
  925. this.detailsPlanNum.accidentcnyAmount = rmbMoney.toFixed(2)
  926. },
  927. // 主表:人民币费用支出 弹框
  928. mainTableExpenseCNY() {
  929. console.log('点击:主表人民币费用支出')
  930. this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYModVis = true
  931. this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYData = this.costPayData
  932. this.$refs.mainTableExpenseCNYModal.fixedData = this.costPayData
  933. },
  934. // 主表:美元费用支出 弹框
  935. mainTableExpenseUSD() {
  936. console.log('点击:主表美元费用支出')
  937. this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDModVis = true
  938. this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDData = this.costPayData
  939. this.$refs.mainTableExpenseUSDModal.fixedData = this.costPayData
  940. },
  941. orderDataChange(data){
  942. this.detailsPlanNum.queryTime = moment(data).format('yyyy-MM-DD')
  943. },
  944. // 事故单 单号 弹框
  945. accidentListCustomCell(record) {
  946. return {
  947. on: {
  948. click: event => {
  949. // this.$router.push({path:'http://localhost:3000/#/IncidentTicketModalDetail'})
  950. // console.log('this:', this)
  951. // // 调用【面料损耗表】中的【事故单】弹框
  952. // this.$refs.accidentListModal.accidentListModVis = true
  953. // this.$refs.accidentListModal.accidentList = record
  954. }
  955. }
  956. }
  957. },
  958. number(data1,data2){
  959. this.detailsPlanNum.fabriccostNotincludestax = data1
  960. },
  961. FabInQua(data,allYu){
  962. this.detailsPlanNum.fabriccostIncludestax=(Number(data)+Number(this.fabricCost)-Number(allYu)).toFixed(2)//面料含税成本
  963. this.detailsPlanNum.fabriccostIncludestaxUsd = (Number(this.detailsPlanNum.fabriccostIncludestax)/1.13/this.detailsPlanNum.exchangeRate).toFixed(2)//表头面料成本($)
  964. this.detailsPlanNum.fabriccostNotincludestax = (Number(this.detailsPlanNum.fabriccostIncludestax)/(1+(Number(this.detailsPlanNum.taxrate)/100))).toFixed(2)
  965. this.$refs.unitTabs.sumInfo.fabricAmount=this.detailsPlanNum.fabriccostIncludestax
  966. this.$refs.unitTabs.sumInfo.fabricExcludTax =(this.detailsPlanNum.fabriccostNotincludestax!==''&&this.detailsPlanNum.fabriccostNotincludestax)?(Number(this.detailsPlanNum.fabriccostNotincludestax)).toFixed(2):''//合计中的不含税面料总额
  967. 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)//合计金额
  968. },
  969. // father 方法
  970. handlecLose() {
  971. this.detailModVis = false
  972. this.AssignedPerson='no',
  973. this.AssignedPersonQx='no',
  974. this.authority='no',
  975. this.detailsPlanNum= {
  976. planNum: ''
  977. }
  978. },
  979. bb() {},
  980. cc() {}
  981. },
  982. computed: {
  983. importExcelUrl: function() {
  984. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  985. },
  986. },
  987. mounted() {}
  988. }
  989. </script>
  990. <style lang="less" scoped>
  991. @import '~@assets/less/common.less';
  992. @import '~@assets/less/overwriter.less';
  993. /deep/ .ant-table-thead > tr > th {
  994. text-align: center;
  995. // font-weight: 700;
  996. }
  997. /deep/ .ant-table-tbody {
  998. text-align: center;
  999. }
  1000. /deep/ .fontColor .ant-form-item-label > label{
  1001. color: red !important;
  1002. }
  1003. // /deep/ th.replacecolor {
  1004. // background-color: #ccc;
  1005. // }
  1006. // 抽屉里的card样式
  1007. // /deep/ .ant-drawer-content {
  1008. // background-color: #f0f2f5;
  1009. // }
  1010. // /deep/ .ant-drawer-body {
  1011. // padding: 10px;
  1012. // }
  1013. // /deep/ form :not(.ant-input-group-wrapper) > .ant-input-group, form .ant-input-group-wrapper{
  1014. // width: 65% !important;
  1015. // }
  1016. // /deep/ .ant-input-group{
  1017. // padding-right: 6px !important;
  1018. // }
  1019. // .taxrate{
  1020. // width: 40%;
  1021. // }
  1022. /deep/.ant-modal-body{
  1023. height: 571px;
  1024. overflow-y: scroll;
  1025. }
  1026. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  1027. border: none;
  1028. padding: 0;
  1029. }
  1030. </style>