paymentSettleDetailsPage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  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 class="el-button--small-yh add-customer-btn" type="primary"
  9. @click.stop="confirmSettlement"confirmSettlement
  10. >{{this.id?"确认修改" :"确认结算"}}
  11. </el-button>
  12. </div>
  13. </div>
  14. <div style="margin-top: 60px">
  15. <containerTitle title="基础信息"></containerTitle>
  16. <basic-container>
  17. <avue-form ref="form" v-model="form" :option="option">
  18. <template slot="corpId">
  19. <select-component
  20. v-model="form.corpId"
  21. :configuration="configuration"
  22. ></select-component>
  23. </template>
  24. </avue-form>
  25. </basic-container>
  26. <basic-container>
  27. <avue-crud :option="itemsOption"
  28. :data="dataList"
  29. ref="crud"
  30. v-model="itemsForm"
  31. :page.sync="page"
  32. @search-reset="searchReset"
  33. @selection-change="selectionChange"
  34. @current-change="currentChange"
  35. @size-change="sizeChange"
  36. @refresh-change="refreshChange">
  37. <template slot="menuLeft">
  38. <el-button type="primary"
  39. size="small"
  40. icon="el-icon-shopping-cart-2"
  41. @click="selectPurchase">选择采购合同
  42. </el-button>
  43. </template>
  44. <template slot-scope="scope" slot="menu">
  45. <el-button
  46. type="text"
  47. icon="el-icon-view"
  48. size="small"
  49. @click.stop=""
  50. >修改
  51. </el-button>
  52. <el-button
  53. type="text"
  54. icon="el-icon-edit"
  55. size="small"
  56. @click.stop=""
  57. >删除
  58. </el-button>
  59. </template>
  60. </avue-crud>
  61. </basic-container>
  62. <el-dialog
  63. title="导入采购"
  64. append-to-body
  65. class="el-dialogDeep"
  66. :visible.sync="procurementDialog"
  67. width="60%"
  68. :close-on-click-modal="false"
  69. :destroy-on-close="true"
  70. :close-on-press-escape="false"
  71. top="10vh"
  72. v-dialog-drag>
  73. <bill-detail
  74. @closeFun="!procurementDialog"
  75. @importProMent="importProMent"
  76. >
  77. </bill-detail>
  78. </el-dialog>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import option from "./configuration/detailsPage.json";
  84. import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
  85. import { getDetails,modify } from "@/api/financialManagement/paymentRequest";
  86. import { contrastObj,contrastList } from "@/util/contrastData";
  87. import billDetail from "@/components/bill/billDetail";
  88. export default {
  89. name: "paymentDetailsPage",
  90. props: {
  91. detailData: {
  92. type: Object
  93. }
  94. },
  95. data() {
  96. return {
  97. form: {},
  98. itemsForm:{},
  99. itemsOption: option,
  100. procurementDialog:false,
  101. id:"",
  102. dataList: [],
  103. currencyDic:[],
  104. page: {
  105. pageSize: 10,
  106. pagerCount: 5,
  107. total: 0,
  108. },
  109. query:{},
  110. option: {
  111. menuBtn: false,
  112. labelWidth: 100,
  113. column: [
  114. {
  115. label: '系统号',
  116. prop: 'sysNo',
  117. span: 8,
  118. disabled: true
  119. },{
  120. label: '合同号',
  121. prop: 'srcOrderno',
  122. span: 8,
  123. rules: [
  124. {
  125. required: true,
  126. message: ' ',
  127. trigger: 'blur'
  128. }
  129. ]
  130. }, {
  131. label: '客户名称',
  132. prop: 'corpId',
  133. sort:true,
  134. span: 8,
  135. rules: [
  136. {
  137. required: false,
  138. message: ' ',
  139. trigger: 'blur'
  140. }
  141. ]
  142. },
  143. {
  144. label: '金额',
  145. prop: 'amount',
  146. span: 8,
  147. rules: [
  148. {
  149. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  150. message: ' ',
  151. trigger: 'blur'
  152. }
  153. ]
  154. }, {
  155. label: '币别',
  156. prop: 'currency',
  157. span: 8,
  158. },
  159. {
  160. label: '汇率',
  161. prop: 'exchangeRate',
  162. span: 8,
  163. rules: [
  164. {
  165. required: false,
  166. message: ' ',
  167. trigger: 'blur'
  168. }
  169. ]
  170. },{
  171. label: '开户银行',
  172. prop: 'accountBank',
  173. span: 8,
  174. rules: [
  175. {
  176. required: false,
  177. message: ' ',
  178. trigger: 'blur'
  179. }
  180. ]
  181. }, {
  182. label: '银行户头',
  183. prop: 'accountName',
  184. span: 8,
  185. rules: [
  186. {
  187. required: false,
  188. message: ' ',
  189. trigger: 'blur'
  190. }
  191. ]
  192. }, {
  193. label: '银行账号',
  194. prop: 'accountNo',
  195. span: 8,
  196. rules: [
  197. {
  198. required: false,
  199. message: ' ',
  200. trigger: 'blur'
  201. }
  202. ]
  203. },
  204. {
  205. label: '制单人',
  206. prop: 'createUserName',
  207. span: 8,
  208. disabled:true,
  209. rules: [
  210. {
  211. required: false,
  212. message: ' ',
  213. trigger: 'blur'
  214. }
  215. ]
  216. }, {
  217. label: '制单日期',
  218. prop: 'createTime',
  219. span: 8,
  220. type:"date",
  221. disabled:true,
  222. rules: [
  223. {
  224. required: false,
  225. message: ' ',
  226. trigger: 'blur'
  227. }
  228. ]
  229. },
  230. {
  231. label: '备注',
  232. prop: 'remark',
  233. span:24,
  234. row:2,
  235. rules: [
  236. {
  237. required: false,
  238. message: ' ',
  239. trigger: 'blur'
  240. }
  241. ]
  242. },
  243. ],
  244. },
  245. //客户组件配置控制
  246. configuration:{
  247. multipleChoices:false,
  248. multiple:false,
  249. disabled:false,
  250. searchShow:true,
  251. collapseTags:false,
  252. placeholder:'请点击右边按钮选择',
  253. dicData:[]
  254. },
  255. financeStatusDic:[{
  256. label:'正常',
  257. value:0
  258. },{
  259. label:'停用',
  260. value:1
  261. }],
  262. //顶部from数据
  263. oldForm:{},
  264. oldDataList:[],
  265. }
  266. },
  267. components:{
  268. billDetail
  269. },
  270. created() {
  271. //币别
  272. this.getWorkDicts("currency").then(res =>{
  273. this.currencyDic = res.data.data
  274. })
  275. if (this.detailData.id) {
  276. this.id = BigInt(this.detailData.id);//字符串转数字 超长用BigInt
  277. getDetail(this.id).then(res => {
  278. this.form = res.data.data;
  279. this.oldForm = Object.assign({},res.data.data);
  280. if(res.data.data.itemsList){
  281. this.dataList = res.data.data.itemsList
  282. this.oldDataList = this.deepClone(res.data.data.itemsList)
  283. }
  284. })
  285. }
  286. if(this.detailData.params){
  287. getDetails(this.detailData.params).then(res =>{
  288. delete res.data.data.id;
  289. delete res.data.data.sysNo;
  290. delete res.data.data.billType;
  291. res.data.data.itemsList.map((items)=>{ delete items.id })
  292. this.form = res.data.data;
  293. this.oldForm = Object.assign({},res.data.data);
  294. if(res.data.data.itemsList){
  295. this.dataList = res.data.data.itemsList
  296. this.oldDataList = this.deepClone(res.data.data.itemsList)
  297. }
  298. })
  299. }
  300. },
  301. mounted() {
  302. option.height = window.innerHeight - 640 ;
  303. },
  304. methods: {
  305. selectPurchase(){
  306. this.procurementDialog = true;
  307. },
  308. importProMent(){
  309. },
  310. searchReset() {
  311. console.log('1')
  312. },
  313. selectionChange() {
  314. console.log('1')
  315. },
  316. currentChange() {
  317. console.log('1')
  318. },
  319. sizeChange() {
  320. console.log('1')
  321. },
  322. refreshChange() {
  323. console.log('1')
  324. },
  325. confirmSettlement(status){
  326. this.$refs["form"].validate((valid) => {
  327. if(valid){
  328. this.$confirm("是否确认结算?", "提示", {
  329. confirmButtonText: "保存",
  330. cancelButtonText: "取消",
  331. type: "warning",
  332. }).then(()=>{
  333. const params = {
  334. ...this.form,
  335. billType:"付款",
  336. itemsList:this.dataList
  337. }
  338. modify(params).then(res =>{
  339. this.$message.success("操作成功!")
  340. this.form = res.data.data;
  341. this.oldForm = Object.assign({},res.data.data);
  342. if(res.data.data.itemsList){
  343. this.dataList = res.data.data.itemsList
  344. this.oldDataList = this.deepClone(res.data.data.itemsList)
  345. }
  346. })
  347. })
  348. if(status === true){
  349. this.$emit("goBack");
  350. }
  351. }
  352. })
  353. },
  354. backToList() {
  355. if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
  356. ){
  357. this.$confirm("是否保存当前页面?", "提示", {
  358. confirmButtonText: "保存",
  359. cancelButtonText: "取消",
  360. type: "warning",
  361. }).then(() => {
  362. this.editCustomer(true)
  363. }).catch(()=>{
  364. this.$emit("goBack");
  365. })
  366. }else{
  367. this.$emit("goBack");
  368. }
  369. },
  370. }
  371. }
  372. </script>
  373. <style scoped>
  374. ::v-deep .el-form-item {
  375. margin-bottom: 0;
  376. }
  377. .main-head {
  378. position: fixed;
  379. top: 105px;
  380. width: 100%;
  381. margin-left: -10px;
  382. height: 62px;
  383. background: #ffffff;
  384. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  385. z-index: 999;
  386. }
  387. .main-back {
  388. cursor: pointer;
  389. line-height: 62px;
  390. font-size: 16px;
  391. color: #323233;
  392. font-weight: 400;
  393. }
  394. .add-customer-btn-two {
  395. position: fixed;
  396. right: 150px;
  397. top: 115px;
  398. }
  399. .add-customer-btn {
  400. position: fixed;
  401. right: 36px;
  402. top: 115px;
  403. }
  404. </style>