cost-allocation-table.vue 47 KB

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