costDetailDrawer.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <!-- 详情 成本分配汇总-->
  3. <div id="costDetailDrawer">
  4. <a-drawer title="详情" width="89%" placement="right" :closable="true" :visible="visible" @close="onClose">
  5. <!-- 主表信息 -->
  6. <a-card :bordered="true">
  7. <div class="table-page-search-wrapper">
  8. <a-form-model layout="inline">
  9. <a-row :gutter="24">
  10. <a-col :md="6" :sm="8">
  11. <a-form-model-item label="计划单号" prop="planNum">
  12. {{ detailsPlanNum.planNum }}
  13. </a-form-model-item>
  14. </a-col>
  15. <a-col :md="6" :sm="8">
  16. <a-form-model-item label="产品款号" prop="poStyleNum">
  17. {{ detailsPlanNum.poStyleNum }}
  18. </a-form-model-item>
  19. </a-col>
  20. <a-col :md="6" :sm="8">
  21. <a-form-model-item label="外销员" prop="exportSales">
  22. {{ detailsPlanNum.exportSales }}
  23. </a-form-model-item>
  24. </a-col>
  25. <a-col :md="6" :sm="8">
  26. <a-form-model-item label="成衣合同号" prop="garmentContractno">
  27. {{ detailsPlanNum.garmentContractno }}
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-model-item label="部门" prop="department">
  32. {{ detailsPlanNum.department }}
  33. </a-form-model-item>
  34. </a-col>
  35. <a-col :md="6" :sm="8">
  36. <a-form-model-item label="客户简称" prop="customerShortame">
  37. {{ detailsPlanNum.customerShortame }}
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :md="6" :sm="8">
  41. <a-form-model-item label="加工单位" prop="processUnit">
  42. {{ detailsPlanNum.processUnit }}
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :md="6" :sm="8">
  46. <a-form-model-item label="出运日期" prop="outdata">
  47. {{ detailsPlanNum.outdata }}
  48. </a-form-model-item>
  49. </a-col>
  50. <a-col :md="6" :sm="8">
  51. <a-form-model-item label="计划数量" prop="planQuantity">
  52. {{ detailsPlanNum.planQuantity }}
  53. </a-form-model-item>
  54. </a-col>
  55. <a-col :md="6" :sm="8">
  56. <a-form-model-item label="美元外销总价" prop="usdTotalexportprice">
  57. {{ detailsPlanNum.usdTotalexportprice }}
  58. </a-form-model-item>
  59. </a-col>
  60. <a-col :md="6" :sm="8">
  61. <a-form-model-item label="人民币费用支出" prop="rmbExpense">
  62. <a href="javascript:void(0)" @click="mainTableExpenseCNY()">{{ detailsPlanNum.rmbExpense }}</a>
  63. </a-form-model-item>
  64. </a-col>
  65. <a-col :md="6" :sm="8">
  66. <a-form-model-item label="税率%" prop="taxrate">
  67. {{ detailsPlanNum.taxrate }}
  68. </a-form-model-item>
  69. </a-col>
  70. <a-col :md="6" :sm="8">
  71. <a-form-model-item label="实际出货数量" prop="actualShipquantity">
  72. {{ detailsPlanNum.actualShipquantity }}
  73. </a-form-model-item>
  74. </a-col>
  75. <a-col :md="6" :sm="8">
  76. <a-form-model-item label="人民币外销金额" prop="rmbExportamount">
  77. {{ detailsPlanNum.rmbExportamount }}
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :md="6" :sm="8">
  81. <a-form-model-item label="美元费用支出" prop="usdExpense">
  82. <a href="javascript:void(0)" @click="mainTableExpenseUSD()">{{ detailsPlanNum.usdExpense }}</a>
  83. </a-form-model-item>
  84. </a-col>
  85. <a-col :md="6" :sm="8">
  86. <a-form-model-item label="加工费" prop="rmbProcesscost">
  87. {{ detailsPlanNum.rmbProcesscost }}
  88. </a-form-model-item>
  89. </a-col>
  90. <a-col :md="6" :sm="8">
  91. <a-form-model-item label="短出数" prop="shortseveral">
  92. {{ detailsPlanNum.shortseveral }}
  93. </a-form-model-item>
  94. </a-col>
  95. <a-col :md="6" :sm="8">
  96. <a-form-model-item label="短出货值" prop="shortvalue">
  97. {{ detailsPlanNum.shortvalue }}
  98. </a-form-model-item>
  99. </a-col>
  100. <a-col :md="6" :sm="8">
  101. <a-form-model-item label="短出面料成本" prop="fabricshortcost">
  102. {{ detailsPlanNum.fabricshortcost }}
  103. </a-form-model-item>
  104. </a-col>
  105. <a-col :md="6" :sm="8">
  106. <a-form-model-item label="事故单美金金额" prop="accidentUsdamount">
  107. {{ detailsPlanNum.accidentUsdamount }}
  108. </a-form-model-item>
  109. </a-col>
  110. <a-col :md="6" :sm="8">
  111. <a-form-model-item label="面料含税成本" prop="fabriccostIncludestax">
  112. {{ detailsPlanNum.fabriccostIncludestax }}
  113. </a-form-model-item>
  114. </a-col>
  115. <a-col :md="6" :sm="8">
  116. <a-form-model-item label="辅料含税成本" prop="excipiencostIncludestax">
  117. {{ detailsPlanNum.excipiencostIncludestax }}
  118. </a-form-model-item>
  119. </a-col>
  120. <a-col :md="6" :sm="8">
  121. <a-form-model-item label="销售订单本币总额" prop="salesordersLocaltotal">
  122. {{ detailsPlanNum.salesordersLocaltotal }}
  123. </a-form-model-item>
  124. </a-col>
  125. <a-col :md="6" :sm="8">
  126. <a-form-model-item label="事故单人民币金额" prop="accidentcnyAmount">
  127. {{ detailsPlanNum.accidentcnyAmount }}
  128. </a-form-model-item>
  129. </a-col>
  130. <a-col :md="6" :sm="8">
  131. <a-form-model-item label="面料不含税成本" prop="fabriccostNotincludestax">
  132. {{ detailsPlanNum.fabriccostNotincludestax }}
  133. </a-form-model-item>
  134. </a-col>
  135. <a-col :md="6" :sm="8">
  136. <a-form-model-item label="辅料不含税成本" prop="excipiencostNotincludestax">
  137. {{ detailsPlanNum.excipiencostNotincludestax }}
  138. </a-form-model-item>
  139. </a-col>
  140. <a-col :md="6" :sm="8">
  141. <a-form-model-item label="销售订单原币总额" prop="salesrrdersOriginaltotal">
  142. {{ detailsPlanNum.salesrrdersOriginaltotal }}
  143. </a-form-model-item>
  144. </a-col>
  145. <a-col :md="6" :sm="8">
  146. <a-form-model-item label="制单人" prop="preparedBy">
  147. {{ detailsPlanNum.preparedBy }}
  148. </a-form-model-item>
  149. </a-col>
  150. <a-col :md="6" :sm="8">
  151. <h4 style="color:red;">
  152. 标记
  153. <span>(计算结果是负值时,该标记是红色)</span>
  154. </h4>
  155. </a-col>
  156. </a-row>
  157. </a-form-model>
  158. </div>
  159. </a-card>
  160. <!-- 子表 -->
  161. <a-card :bordered="true" style="margin:10px 0">
  162. <!--tabs 组件引入 style="marginTop:60px;" -->
  163. <div>
  164. <tabs ref="unitTabs" />
  165. </div>
  166. </a-card>
  167. <!-- 事故单 -->
  168. <a-card :bordered="true" style="margin:10px 0">
  169. <div style="margin:60px 0 40px 0">
  170. <h6 class="table-title">事故单</h6>
  171. <a-table
  172. rowKey="id"
  173. :loading="loading"
  174. :columns="accidentListColumns"
  175. :data-source="accidentListData"
  176. bordered
  177. :pagination="false"
  178. :scroll="{ y: 300 }"
  179. >
  180. <!-- 事故单 -->
  181. <span slot="accidentNum" slot-scope="text">
  182. <a>{{ text }}</a>
  183. </span>
  184. </a-table>
  185. </div>
  186. <!-- 费用支出 -->
  187. <div>
  188. <h6 class="table-title">费用支出</h6>
  189. <a-table
  190. rowKey="id"
  191. :loading="loading"
  192. :columns="costPayColumns"
  193. :data-source="costPayData"
  194. bordered
  195. :pagination="false"
  196. >
  197. </a-table>
  198. </div>
  199. <!-- 备注信息 根据角色权限控制【填写】、【查看】-->
  200. <div class="note-one" style="marginTop:40px;">
  201. <h6 class="table-title">备注信息</h6>
  202. <div class="noteDetail">
  203. {{ detailsPlanNum.remarks }}
  204. </div>
  205. </div>
  206. </a-card>
  207. </a-drawer>
  208. <!-- 所有弹框 -->
  209. <div>
  210. <!-- 主表 人民币费用支出 弹框 -->
  211. <mainTableExpenseCNY-modal ref="mainTableExpenseCNYModal" :father="aa"></mainTableExpenseCNY-modal>
  212. <!-- 主表 美元费用支出 弹框 -->
  213. <mainTableExpenseUSD-modal ref="mainTableExpenseUSDModal" :father="bb"></mainTableExpenseUSD-modal>
  214. <!-- 事故单 -->
  215. <accidentList-modal ref="accidentListModal" :father="cc"></accidentList-modal>
  216. </div>
  217. </div>
  218. </template>
  219. <script>
  220. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  221. import JEllipsis from '@/components/jeecg/JEllipsis'
  222. import moment from 'moment'
  223. import tabs from '@views/cost-allocation-total/tabs.vue' // tabs组件
  224. import mainTableExpenseCNYModal from '@views/cost-allocation-total/modal/mainTableExpenseCNYModal.vue'
  225. import mainTableExpenseUSDModal from '@views/cost-allocation-total/modal/mainTableExpenseUSDModal.vue'
  226. import accidentListModal from '@views/cost-allocation-total/modal/accidentListModal.vue' // 事故单
  227. import { costByPlanNum } from '@api/document/cost-allocation-total.js'
  228. export default {
  229. name: 'CostDetailDrawer', // 详情抽屉
  230. mixins: [JeecgListMixin],
  231. components: { JEllipsis, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal },
  232. data() {
  233. return {
  234. loading: false, // 表格加载
  235. detailsPlanNum: {}, //详情所有数据
  236. remarks: '', // 备注
  237. // 事故单 表头
  238. accidentListColumns: [
  239. {
  240. title: '单号',
  241. width: 120,
  242. dataIndex: 'accidentNum',
  243. className: 'replacecolor',
  244. customCell: this.accidentListCustomCell,
  245. scopedSlots: { customRender: 'accidentNum' }
  246. },
  247. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  248. { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
  249. ],
  250. accidentListData: [],
  251. // 费用支出 表头
  252. costPayColumns: [
  253. { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
  254. { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo', className: 'replacecolor' },
  255. { title: '费用项目', dataIndex: 'expenseItem', width: 120, className: 'replacecolor' },
  256. { title: ' 支出本币金额', dataIndex: 'disbursedLocalmoney', width: 120, className: 'replacecolor' },
  257. { title: '支出原币金额', dataIndex: 'disbursedOriginalmoney', width: 120, className: 'replacecolor' },
  258. { title: '发票号', dataIndex: 'invoicenum', width: 120, className: 'replacecolor' },
  259. { title: '制单人', dataIndex: 'preparedBy', width: 120, className: 'replacecolor' }
  260. ],
  261. costPayData: [],
  262. visible: false,
  263. record: {} //点击的计划单号
  264. }
  265. },
  266. created() {
  267. this.getALLDetail()
  268. },
  269. methods: {
  270. // 详情所有数据
  271. getALLDetail() {
  272. this.$nextTick(() => {
  273. // console.log('详情拿到planNum', this.record.planNum)
  274. costByPlanNum({ plannum: this.record.planNum, type: 'query' }).then(res => {
  275. if (res.success) {
  276. this.detailsPlanNum = res.result //所有详情
  277. this.accidentListData = res.result.syCostAllocationAccidentList //事故单
  278. this.costPayData = res.result.syCostAllocationCostpayList //支出费用
  279. // tabs 名称集合
  280. this.$refs.unitTabs.tabNameList = res.result.processUnit.split(',')
  281. //所有tabs数据
  282. this.$refs.unitTabs.tabsAllData = res.result.processUnitList
  283. // 页面打开加载的数据
  284. var oneData = this.$refs.unitTabs.tabsAllData[0]
  285. this.$refs.unitTabs.fabData = oneData.syCostAllocationFabricList
  286. this.$refs.unitTabs.ingData = oneData.syCostAllocationIngredientList
  287. this.$refs.unitTabs.shipData = oneData.syCostAllocationShipdetailList
  288. this.pagination = {
  289. total: res.result.total,
  290. current: res.result.current,
  291. pageSize: res.result.size
  292. }
  293. }
  294. })
  295. })
  296. },
  297. // 主表:人民币费用支出 弹框
  298. mainTableExpenseCNY() {
  299. console.log('点击:主表人民币费用支出')
  300. this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYModVis = true
  301. },
  302. // 主表:美元费用支出 弹框
  303. mainTableExpenseUSD() {
  304. console.log('点击:主表美元费用支出')
  305. this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDModVis = true
  306. },
  307. // 事故单 单号 弹框
  308. accidentListCustomCell(record) {
  309. return {
  310. on: {
  311. click: event => {
  312. console.log('this:', this)
  313. // 调用【面料损耗表】中的【事故单】弹框
  314. this.$refs.accidentListModal.accidentListModVis = true
  315. }
  316. }
  317. }
  318. },
  319. onClose() {
  320. this.visible = false
  321. },
  322. // --------------------------------------------------
  323. // father 方法
  324. aa() {},
  325. bb() {},
  326. cc() {}
  327. }
  328. }
  329. </script>
  330. <style lang="less" scoped>
  331. @import '~@assets/less/common.less';
  332. @import '~@assets/less/overwriter.less';
  333. /deep/ .ant-table-thead > tr > th {
  334. text-align: center;
  335. // font-weight: 700;
  336. }
  337. /deep/ .ant-table-tbody {
  338. text-align: center;
  339. }
  340. // /deep/ th.replacecolor {
  341. // background-color: #ccc;
  342. // }
  343. // 抽屉里的card样式
  344. /deep/ .ant-drawer-content {
  345. background-color: #f0f2f5;
  346. }
  347. /deep/ .ant-drawer-body {
  348. padding: 10px;
  349. }
  350. // 回显label文字
  351. /deep/.ant-form-item-label > label {
  352. font-weight: 700;
  353. color: #333;
  354. }
  355. </style>