costDetailDrawer.vue 48 KB

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