paymentRequestDetails.vue 11 KB

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