paymentDetailsPage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <div class="borderless">
  3. <div class="main-head">
  4. <div class="main-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. <el-button type="success"
  9. class="el-button--small-yh add-customer-btn-two"
  10. :disabled="true"
  11. @click.stop="">复制新单
  12. </el-button>
  13. <el-button class="el-button--small-yh add-customer-btn" type="primary"
  14. @click.stop="editFinance"
  15. >{{this.id?"确认修改" :"确认新增"}}
  16. </el-button>
  17. </div>
  18. </div>
  19. <div style="margin-top: 60px">
  20. <containerTitle title="基础信息"></containerTitle>
  21. <basic-container>
  22. <el-form :model="form" ref="form" label-width="130px">
  23. <el-row>
  24. <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:8" :key="index">
  25. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  26. <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" :disabled="item.disabled?true:false" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  27. <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择" clearable filterable></el-select>
  28. <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
  29. <el-select v-else-if="item.prop === 'currency'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
  30. <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  31. </el-select>
  32. <el-select v-else-if="item.prop === 'financeStatus'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
  33. <el-option
  34. v-for="item in financeStatusDic"
  35. :key="item.value"
  36. :label="item.label"
  37. :value="item.value">
  38. </el-option>
  39. </el-select>
  40. <el-input type="age" v-else-if="item.prop === 'exchangeRate'" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入">
  41. <template slot="append">%</template>
  42. </el-input>
  43. <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
  44. <el-input type="age" v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" autocomplete="off" placeholder="请输入"></el-input>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-form>
  49. </basic-container>
  50. <basic-container>
  51. <avue-crud :option="option"
  52. :data="dataList"
  53. ref="crud"
  54. v-model="form"
  55. :page.sync="page"
  56. @search-reset="searchReset"
  57. @selection-change="selectionChange"
  58. @current-change="currentChange"
  59. @size-change="sizeChange"
  60. @refresh-change="refreshChange">
  61. <template slot="menuLeft">
  62. <el-button type="primary"
  63. size="small"
  64. icon="el-icon-shopping-cart-2"
  65. @click="">选择采购合同
  66. </el-button>
  67. <el-button
  68. icon="el-icon-printer"
  69. size="small"
  70. type="primary"
  71. @click.stop="openReport()"
  72. >报 表
  73. </el-button>
  74. </template>
  75. <template slot="menuRight">
  76. <el-button type="info"
  77. size="small"
  78. @click="">请核
  79. </el-button>
  80. </template>
  81. <template slot-scope="scope" slot="menu">
  82. <el-button
  83. type="text"
  84. icon="el-icon-view"
  85. size="small"
  86. @click.stop=""
  87. >费用确认
  88. </el-button>
  89. <el-button
  90. type="text"
  91. icon="el-icon-edit"
  92. size="small"
  93. @click.stop=""
  94. >移除数据
  95. </el-button>
  96. </template>
  97. </avue-crud>
  98. </basic-container>
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. import option from "./configuration/detailsPage.json";
  104. import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
  105. import {detailListData } from "@/api/importTrade/purchase";
  106. import {getSysNo} from "@/api/importTrade/purchase";
  107. import { getUserInfo } from "@/api/system/user";
  108. export default {
  109. name: "paymentDetailsPage",
  110. props: {
  111. detailData: {
  112. type: Object
  113. }
  114. },
  115. data() {
  116. return {
  117. form: {},
  118. option: option,
  119. parentId:0,
  120. id:"",
  121. dataList: [],
  122. currencyDic:[],
  123. page: {
  124. pageSize: 10,
  125. pagerCount: 5,
  126. total: 0,
  127. },
  128. query:{},
  129. //客户组件配置控制
  130. configuration:{
  131. multipleChoices:false,
  132. multiple:false,
  133. disabled:false,
  134. searchShow:true,
  135. collapseTags:false,
  136. placeholder:'请点击右边按钮选择',
  137. dicData:[]
  138. },
  139. financeStatusDic:[{
  140. label:'正常',
  141. value:0
  142. },{
  143. label:'停用',
  144. value:1
  145. }],
  146. //顶部from数据
  147. basicData: {
  148. column: [
  149. {
  150. label: '系统号',
  151. prop: 'sysNo',
  152. disabled:true,
  153. rules: [
  154. {
  155. required: true,
  156. message: ' ',
  157. trigger: 'blur'
  158. }
  159. ]
  160. },{
  161. label: '合同号',
  162. prop: 'srcOrderno',
  163. rules: [
  164. {
  165. required: true,
  166. message: ' ',
  167. trigger: 'blur'
  168. }
  169. ]
  170. }, {
  171. label: '供应商',
  172. prop: 'corpId',
  173. rules: [
  174. {
  175. required: false,
  176. message: ' ',
  177. trigger: 'blur'
  178. }
  179. ]
  180. },
  181. {
  182. label: '金额',
  183. prop: 'amount',
  184. rules: [
  185. {
  186. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  187. message: ' ',
  188. trigger: 'blur'
  189. }
  190. ]
  191. }, {
  192. label: '币别',
  193. prop: 'currency'
  194. },
  195. {
  196. label: '汇率',
  197. prop: 'exchangeRate',
  198. rules: [
  199. {
  200. required: false,
  201. message: ' ',
  202. trigger: 'blur'
  203. }
  204. ]
  205. },{
  206. label: '银行名称',
  207. prop: 'accountBank',
  208. rules: [
  209. {
  210. required: false,
  211. message: ' ',
  212. trigger: 'blur'
  213. }
  214. ]
  215. }, {
  216. label: '银行户头',
  217. prop: 'accountName',
  218. rules: [
  219. {
  220. required: false,
  221. message: ' ',
  222. trigger: 'blur'
  223. }
  224. ]
  225. }, {
  226. label: '银行账号',
  227. prop: 'accountNo',
  228. rules: [
  229. {
  230. required: false,
  231. message: ' ',
  232. trigger: 'blur'
  233. }
  234. ]
  235. },
  236. {
  237. label: '手续费',
  238. prop: 'serviceCharge',
  239. rules: [
  240. {
  241. required: false,
  242. message: ' ',
  243. trigger: 'blur'
  244. }
  245. ]
  246. },
  247. {
  248. label: '要求付款日期',
  249. prop: 'orderNo',
  250. type:"date",
  251. rules: [
  252. {
  253. required: false,
  254. message: ' ',
  255. trigger: 'blur'
  256. }
  257. ]
  258. }, {
  259. label: '实际付款日期',
  260. prop: 'orderNo',
  261. type:"date",
  262. rules: [
  263. {
  264. required: false,
  265. message: ' ',
  266. trigger: 'blur'
  267. }
  268. ]
  269. },
  270. {
  271. label: '单据状态',
  272. prop: 'financeStatus',
  273. }, {
  274. label: '制单人',
  275. prop: 'createUserName',
  276. disabled:true,
  277. rules: [
  278. {
  279. required: false,
  280. message: ' ',
  281. trigger: 'blur'
  282. }
  283. ]
  284. }, {
  285. label: '制单日期',
  286. prop: 'createTime',
  287. type:"date",
  288. disabled:true,
  289. rules: [
  290. {
  291. required: false,
  292. message: ' ',
  293. trigger: 'blur'
  294. }
  295. ]
  296. },
  297. {
  298. label: '备注',
  299. prop: 'remark',
  300. span:24,
  301. rules: [
  302. {
  303. required: false,
  304. message: ' ',
  305. trigger: 'blur'
  306. }
  307. ]
  308. },
  309. ],
  310. },
  311. }
  312. },
  313. created() {
  314. //币别
  315. this.getWorkDicts("currency").then(res =>{
  316. this.currencyDic = res.data.data
  317. })
  318. if (this.detailData.id) {
  319. this.id = BigInt(this.detailData.id);//字符串转数字 超长用BigInt
  320. getDetail(this.id).then(res => {
  321. this.form = res.data.data;
  322. this.configuration.dicData = res.data.data.customerModel;
  323. this.dataList = res.data.data.itemsList
  324. })
  325. }else{
  326. this.assignment()
  327. }
  328. if(this.detailData.params){
  329. detailListData(this.detailData.params.id).then(res =>{
  330. this.form.corpId = res.data.data.corpId;
  331. this.form.srcOrderno = res.data.data.orderNo;
  332. this.configuration.dicData = res.data.data.corpsName;
  333. res.data.data.itemsVOList.forEach((item,index) =>{
  334. this.detailData.params.orderItemIds.forEach((e,i) =>{
  335. if(e == index){
  336. const params ={
  337. srcOrderno:res.data.data.orderNo,
  338. amount:item.amount,
  339. createUserName:item.createUserName,
  340. createTime:item.createTime,
  341. }
  342. this.$refs.crud.rowCellAdd(params);
  343. this.$refs.crud.rowCell(params,this.dataList.length - 1)
  344. }
  345. })
  346. })
  347. })
  348. this.assignment()
  349. }
  350. },
  351. mounted() {
  352. option.height = window.innerHeight - 640 ;
  353. },
  354. methods: {
  355. assignment(){
  356. getSysNo("CW-FK").then(res =>{
  357. this.$set(this.form,"sysNo", res.data.data)
  358. let date = new Date();
  359. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  360. this.$set(this.form,"createTime",strDate)
  361. })
  362. getUserInfo().then(res =>{
  363. this.$set(this.form,"createUserName", res.data.data.name)
  364. })
  365. },
  366. searchReset() {
  367. console.log('1')
  368. },
  369. selectionChange() {
  370. console.log('1')
  371. },
  372. currentChange() {
  373. console.log('1')
  374. },
  375. sizeChange() {
  376. console.log('1')
  377. },
  378. refreshChange() {
  379. console.log('1')
  380. },
  381. editFinance(status){
  382. this.$refs["form"].validate((valid) => {
  383. if(valid){
  384. const params = {
  385. ...this.form,
  386. billType:"付费",
  387. itemsList:this.dataList
  388. }
  389. editFinance(params).then(res =>{
  390. if(res.data.success){
  391. this.$message.success("操作成功!")
  392. }
  393. })
  394. if(status === true){
  395. this.$emit("goBack");
  396. }
  397. }
  398. })
  399. },
  400. backToList(){
  401. this.$confirm("是否保存当前页面?", "提示", {
  402. confirmButtonText: "保存",
  403. cancelButtonText: "取消",
  404. type: "warning",
  405. }).then(() => {
  406. this.editFinance(true)
  407. }).catch(() => {
  408. this.$emit("goBack");
  409. })
  410. }
  411. }
  412. }
  413. </script>
  414. <style scoped>
  415. ::v-deep .el-form-item {
  416. margin-bottom: 0;
  417. }
  418. .main-head {
  419. position: fixed;
  420. top: 105px;
  421. width: 100%;
  422. margin-left: -10px;
  423. height: 62px;
  424. background: #ffffff;
  425. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  426. z-index: 999;
  427. }
  428. .main-back {
  429. cursor: pointer;
  430. line-height: 62px;
  431. font-size: 16px;
  432. color: #323233;
  433. font-weight: 400;
  434. }
  435. .add-customer-btn-two {
  436. position: fixed;
  437. right: 150px;
  438. top: 115px;
  439. }
  440. .add-customer-btn {
  441. position: fixed;
  442. right: 36px;
  443. top: 115px;
  444. }
  445. </style>