cost-allocation-add.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <!-- 成本分配 (保存后数据到单证的成本分配汇总内)-->
  3. <div id="costAllocationAdd">
  4. <a-card :bordered="false">
  5. <!-- 主表信息 点击搜索后 全部回显--->
  6. <div class="table-page-search-wrapper">
  7. <a-form-model layout="inline" ref="form" :model="costAllocationAdd" :rules="validatorRules">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-model-item label="计划单号" prop="planNum">
  11. <!-- <a-input placeholder="请输入计划单号" v-model="costAllocationAdd.planNum"></a-input> -->
  12. <a-input-search
  13. placeholder="请输入计划单号"
  14. enter-button
  15. v-model="costAllocationAdd.planNum"
  16. @search="onSearch"
  17. />
  18. </a-form-model-item>
  19. </a-col>
  20. <!-- 输入【计划单号】点击搜索后,回显以下所有信息,【备注】需要输入,后进行保存 disabled -->
  21. <a-col :md="6" :sm="8">
  22. <a-form-model-item label="产品款号" prop="poStyleNum">
  23. 产品款号AZ2445
  24. <!-- <a-input v-model="costAllocationAdd.poStyleNum" disabled></a-input> -->
  25. </a-form-model-item>
  26. </a-col>
  27. <a-col :md="6" :sm="8">
  28. <a-form-model-item label="外销员" prop="exportSales">
  29. <a-input v-model="costAllocationAdd.exportSales" ></a-input>
  30. </a-form-model-item>
  31. </a-col>
  32. <a-col :md="6" :sm="8">
  33. <a-form-model-item label="成衣合同号" prop="garmentContractNo">
  34. <a-input v-model="costAllocationAdd.garmentContractNo"></a-input>
  35. </a-form-model-item>
  36. </a-col>
  37. <a-col :md="6" :sm="8">
  38. <a-form-model-item label="部门" prop="department">
  39. <a-input v-model="costAllocationAdd.department"></a-input>
  40. </a-form-model-item>
  41. </a-col>
  42. <a-col :md="6" :sm="8">
  43. <a-form-model-item label="客户简称" prop="customerShortName">
  44. <a-input v-model="costAllocationAdd.customerShortName"></a-input>
  45. </a-form-model-item>
  46. </a-col>
  47. <a-col :md="6" :sm="8">
  48. <a-form-model-item label="加工单位" prop="processUnit">
  49. <a-input v-model="costAllocationAdd.processUnit"></a-input>
  50. </a-form-model-item>
  51. </a-col>
  52. <a-col :md="6" :sm="8">
  53. <a-form-model-item label="出运日期" prop="outData">
  54. <a-date-picker
  55. style="width: 100%"
  56. :format="dateFormat"
  57. v-model="costAllocationAdd.outData"
  58. ></a-date-picker>
  59. </a-form-model-item>
  60. </a-col>
  61. <a-col :md="6" :sm="8">
  62. <a-form-model-item label="计划数量" prop="planQuantity">
  63. <a-input v-model="costAllocationAdd.planQuantity"></a-input>
  64. </a-form-model-item>
  65. </a-col>
  66. <a-col :md="6" :sm="8">
  67. <a-form-model-item label="美元外销总价" prop="USDTotalExportPrice">
  68. <a-input v-model="costAllocationAdd.USDTotalExportPrice"></a-input>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :md="6" :sm="8">
  72. <a-form-model-item label="人民币费用支出" prop="RMBExpense">
  73. <a-input
  74. v-model="costAllocationAdd.RMBExpense"
  75. style="color:#027db4;"
  76. @click="mainTableExpenseCNY"
  77. ></a-input>
  78. </a-form-model-item>
  79. </a-col>
  80. <a-col :md="6" :sm="8">
  81. <a-form-model-item label="税率%" prop="taxRate">
  82. <a-input v-model="costAllocationAdd.taxRate"></a-input>
  83. </a-form-model-item>
  84. </a-col>
  85. <a-col :md="6" :sm="8">
  86. <a-form-model-item label="实际出货数量" prop="actualShipQuantity">
  87. <a-input v-model="costAllocationAdd.actualShipQuantity"></a-input>
  88. </a-form-model-item>
  89. </a-col>
  90. <a-col :md="6" :sm="8">
  91. <a-form-model-item label="人民币外销金额" prop="RMBExportAmount">
  92. <a-input v-model="costAllocationAdd.RMBExportAmount"></a-input>
  93. </a-form-model-item>
  94. </a-col>
  95. <a-col :md="6" :sm="8">
  96. <a-form-model-item label="美元费用支出" prop="USDExpense">
  97. <a-input
  98. v-model="costAllocationAdd.USDExpense"
  99. style="color:#027db4;"
  100. @click="mainTableExpenseUSD"
  101. ></a-input>
  102. </a-form-model-item>
  103. </a-col>
  104. <a-col :md="6" :sm="8">
  105. <a-form-model-item label="加工费" prop="processCost">
  106. <a-input v-model="costAllocationAdd.processCost"></a-input>
  107. </a-form-model-item>
  108. </a-col>
  109. <a-col :md="6" :sm="8">
  110. <a-form-model-item label="短出数" prop="shortSeveral">
  111. <a-input v-model="costAllocationAdd.shortSeveral"></a-input>
  112. </a-form-model-item>
  113. </a-col>
  114. <a-col :md="6" :sm="8">
  115. <a-form-model-item label="短出货值" prop="shortValue">
  116. <a-input v-model="costAllocationAdd.shortValue"></a-input>
  117. </a-form-model-item>
  118. </a-col>
  119. <a-col :md="6" :sm="8">
  120. <a-form-model-item label="短出面料成本" prop="fabricShortCost">
  121. <a-input v-model="costAllocationAdd.fabricShortCost"></a-input>
  122. </a-form-model-item>
  123. </a-col>
  124. <a-col :md="6" :sm="8">
  125. <a-form-model-item label="事故单美金金额" prop="accidentUSDAmount">
  126. <a-input v-model="costAllocationAdd.accidentUSDAmount"></a-input>
  127. </a-form-model-item>
  128. </a-col>
  129. <a-col :md="6" :sm="8">
  130. <a-form-model-item label="面料含税成本" prop="fabricCostIncludesTax">
  131. <a-input v-model="costAllocationAdd.fabricCostIncludesTax"></a-input>
  132. </a-form-model-item>
  133. </a-col>
  134. <a-col :md="6" :sm="8">
  135. <a-form-model-item label="辅料含税成本" prop="excipienCostIncludesTax">
  136. <a-input v-model="costAllocationAdd.excipienCostIncludesTax"></a-input>
  137. </a-form-model-item>
  138. </a-col>
  139. <a-col :md="6" :sm="8">
  140. <a-form-model-item label="销售订单本币总额" prop="salesOrdersLocalTotal">
  141. <a-input v-model="costAllocationAdd.salesOrdersLocalTotal"></a-input>
  142. </a-form-model-item>
  143. </a-col>
  144. <a-col :md="6" :sm="8">
  145. <a-form-model-item label="事故单人民币金额" prop="accidentCNYAmount">
  146. <a-input v-model="costAllocationAdd.accidentCNYAmount"></a-input>
  147. </a-form-model-item>
  148. </a-col>
  149. <a-col :md="6" :sm="8">
  150. <a-form-model-item label="面料不含税成本" prop="fabricCostNotIncludesTax">
  151. <a-input v-model="costAllocationAdd.fabricCostNotIncludesTax"></a-input>
  152. </a-form-model-item>
  153. </a-col>
  154. <a-col :md="6" :sm="8">
  155. <a-form-model-item label="辅料不含税成本" prop="excipienCostNotIncludesTax">
  156. <a-input v-model="costAllocationAdd.excipienCostNotIncludesTax"></a-input>
  157. </a-form-model-item>
  158. </a-col>
  159. <a-col :md="6" :sm="8">
  160. <a-form-model-item label="销售订单原币总额" prop="salesOrdersOriginalTotal">
  161. <a-input v-model="costAllocationAdd.salesOrdersOriginalTotal"></a-input>
  162. </a-form-model-item>
  163. </a-col>
  164. <a-col :md="6" :sm="8">
  165. <a-form-model-item label="制单人" prop="preparedBy">
  166. <a-input v-model="costAllocationAdd.preparedBy"></a-input>
  167. </a-form-model-item>
  168. </a-col>
  169. <a-col :md="6" :sm="8">
  170. <h4 style="color:red;">
  171. 标记
  172. <span>(计算结果是负值时,该标记是红色)</span>
  173. </h4>
  174. </a-col>
  175. </a-row>
  176. </a-form-model>
  177. </div>
  178. <!--tabs 组件引入 -->
  179. <tabs />
  180. <!-- 事故单 -->
  181. <div style="margin:40px 0">
  182. <h6 class="table-title">事故单</h6>
  183. <a-table
  184. rowKey="id"
  185. :loading="loading"
  186. :columns="accidentListColumns"
  187. :data-source="accidentListData"
  188. bordered
  189. :pagination="false"
  190. >
  191. <!-- 事故单 -->
  192. <span slot="accidentNum" slot-scope="text">
  193. <a>{{ text }}</a>
  194. </span>
  195. </a-table>
  196. </div>
  197. <!-- 费用支出 -->
  198. <div>
  199. <h6 class="table-title">费用支出</h6>
  200. <a-table
  201. rowKey="id"
  202. :loading="loading"
  203. :columns="costPayColumns"
  204. :data-source="costPayData"
  205. bordered
  206. :pagination="false"
  207. >
  208. </a-table>
  209. </div>
  210. <!-- 备注信息 1 根据角色判断 显示备注 1 或备注 2-->
  211. <div class="note-one" style="marginTop:40px;">
  212. <h6 class="table-title">备注信息 1</h6>
  213. <div class="noteDetail">
  214. <a-form-model ref="form" :model="costAllocationAdd" :rues="validatorRules">
  215. <a-form-model-item prop="noteOne">
  216. <a-input
  217. type="textarea"
  218. v-model="costAllocationAdd.noteOne"
  219. placeholder="请输入备注"
  220. style="minHeight:100px;"
  221. />
  222. </a-form-model-item>
  223. </a-form-model>
  224. </div>
  225. </div>
  226. <!-- 备注信息 2 根据角色判断 显示备注 1 或备注 2-->
  227. <!-- <div class="note-one" style="marginTop:40px;">
  228. <h6 class="table-title">备注信息 2</h6>
  229. <div class="noteDetail">
  230. <a-form-model ref="form" :model="costAllocationAdd" :rues="validatorRules">
  231. <a-form-model-item prop="noteOne">
  232. <a-input
  233. type="textarea"
  234. v-model="costAllocationAdd.noteTwo"
  235. placeholder="请输入备注"
  236. style="minHeight:100px;"
  237. />
  238. </a-form-model-item>
  239. </a-form-model>
  240. </div>
  241. </div> -->
  242. <!-- 页面底部保存 -->
  243. <a-row :gutter="24" style="marginTop:40px;float:right">
  244. <a-col :md="12" :sm="12">
  245. <a-button type="primary" @click="save">
  246. 保存
  247. </a-button>
  248. </a-col>
  249. </a-row>
  250. </a-card>
  251. <!-- 弹框 -->
  252. <div>
  253. <!-- 主表 人民币费用支出 弹框 -->
  254. <mainTableExpenseCNY-modal ref="mainTableExpenseCNYModal" :father="aa"></mainTableExpenseCNY-modal>
  255. <!-- 主表 美元费用支出 弹框 -->
  256. <mainTableExpenseUSD-modal ref="mainTableExpenseUSDModal" :father="bb"></mainTableExpenseUSD-modal>
  257. <!-- 事故单 -->
  258. <accidentList-modal ref="accidentListModal" :father="cc"></accidentList-modal>
  259. </div>
  260. </div>
  261. </template>
  262. <script>
  263. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  264. import JEllipsis from '@/components/jeecg/JEllipsis'
  265. import moment from 'moment'
  266. import tabs from '@views/reportForms/cost-allocation-table/tabs.vue' // tabs组件
  267. import mainTableExpenseCNYModal from '@views/reportForms/cost-allocation-table/mainTableExpenseCNYModal.vue'
  268. import mainTableExpenseUSDModal from '@views/reportForms/cost-allocation-table/mainTableExpenseUSDModal.vue'
  269. import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue' // 事故单
  270. export default {
  271. name: 'CostAllocationAdd', // 成本分配 (新增)
  272. mixins: [JeecgListMixin],
  273. components: { JEllipsis, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal },
  274. data() {
  275. return {
  276. loading: false, // 表格加载
  277. costAllocationAdd: {}, // 成本分配统计
  278. dateFormat: 'YYYY-MM-DD',
  279. noteOne: '', // 备注 1
  280. noteTwo: '', // 备注 2
  281. // 事故单 表头
  282. accidentListColumns: [
  283. {
  284. title: '单号',
  285. width: 120,
  286. dataIndex: 'accidentNum',
  287. className: 'replacecolor',
  288. customCell: this.accidentListCustomCell,
  289. scopedSlots: { customRender: 'accidentNum' }
  290. },
  291. { title: '事故承担方', width: 120, dataIndex: 'accidentUndertaker', className: 'replacecolor' },
  292. { title: '金额', dataIndex: 'amount', width: 120, className: 'replacecolor' }
  293. ],
  294. accidentListData: [{ accidentNum: '1100011' }, {}],
  295. // 费用支出 表头
  296. costPayColumns: [
  297. { title: '账套号', width: 120, dataIndex: 'setNo', className: 'replacecolor' },
  298. { title: '支出单号', width: 120, dataIndex: 'disbursementSlipNo', className: 'replacecolor' },
  299. { title: '费用项目', dataIndex: 'expenseItem', width: 120, className: 'replacecolor' },
  300. { title: ' 支出本币金额', dataIndex: 'disbursedLocalMoney', width: 120, className: 'replacecolor' },
  301. { title: '支出原币金额', dataIndex: 'disbursedOriginalMoney', width: 120, className: 'replacecolor' },
  302. { title: '发票号', dataIndex: 'invoiceNum', width: 120, className: 'replacecolor' },
  303. { title: '制单人', dataIndex: 'preparedBy', width: 120, className: 'replacecolor' }
  304. ],
  305. costPayData: [{}],
  306. visible: true, // 成本分配 新增
  307. validatorRules: {
  308. planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
  309. }
  310. }
  311. },
  312. created() {},
  313. methods: {
  314. // 【计划单号】 搜索
  315. onSearch(value) {
  316. console.log('【计划单号】 ', value)
  317. // 根据计划单号查询该页面所有信息且回显
  318. },
  319. // 主表:人民币费用支出 弹框
  320. mainTableExpenseCNY() {
  321. console.log('点击:主表人民币费用支出')
  322. this.$refs.mainTableExpenseCNYModal.mainTableExpenseCNYModVis = true
  323. },
  324. // 主表:美元费用支出 弹框
  325. mainTableExpenseUSD() {
  326. console.log('点击:主表美元费用支出')
  327. this.$refs.mainTableExpenseUSDModal.mainTableExpenseUSDModVis = true
  328. },
  329. // 事故单 单号 弹框
  330. accidentListCustomCell(record) {
  331. return {
  332. on: {
  333. click: event => {
  334. console.log('this:', this)
  335. // 调用【面料损耗表】中的【事故单】弹框
  336. this.$refs.accidentListModal.accidentListModVis = true
  337. }
  338. }
  339. }
  340. },
  341. // --------------------------------------
  342. // 页面 保存
  343. save() {
  344. console.log('保存该计划单号的备注、数据保存到单证【成本分配汇总】,覆盖该计划单号之前的信息')
  345. const that = this
  346. this.$refs.form.validate(valid => {
  347. if (valid) {
  348. // alert('保存!')
  349. console.log('备注信息:', this.costAllocationAdd.noteOne, '计划单号:', this.costAllocationAdd.planNum)
  350. // that.$message.success(res.message)
  351. that.$message.success('保存成功,数据添加到成本分配汇总')
  352. } else {
  353. this.$message.info('请选择计划单号、输入备注信息')
  354. }
  355. })
  356. },
  357. // father 方法
  358. aa() {},
  359. bb() {},
  360. cc() {}
  361. },
  362. computed: {},
  363. mounted() {}
  364. }
  365. </script>
  366. <style lang="less" scoped>
  367. @import '~@assets/less/common.less';
  368. @import '~@assets/less/overwriter.less';
  369. /deep/ .ant-table-thead > tr > th {
  370. text-align: center;
  371. // font-weight: 700;
  372. }
  373. /deep/ .ant-table-tbody {
  374. text-align: center;
  375. }
  376. // /deep/ th.replacecolor {
  377. // background-color: #ccc;
  378. // }
  379. // 抽屉里的card样式
  380. // /deep/ .ant-drawer-content {
  381. // background-color: #f0f2f5;
  382. // }
  383. // /deep/ .ant-drawer-body {
  384. // padding: 10px;
  385. // }
  386. </style>