cost-allocation-table.vue 49 KB

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