costDetailDrawer.vue 45 KB

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