settleAccountsDetailsPage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <template>
  2. <div class="borderless">
  3. <div class="receipt-head">
  4. <div class="receipt-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>
  9. </div>
  10. <div style="margin-top: 60px">
  11. <containerTitle title="基础信息"></containerTitle>
  12. <basic-container >
  13. <el-form :model="form" ref="form" label-width="130px">
  14. <el-row>
  15. <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:6" :key="index">
  16. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  17. <el-date-picker v-if="item.type === 'datetime'" :disabled="item.disabled?true:false" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  18. <el-select v-else-if="item.prop === 'paymentType'" :disabled="item.disabled?true:false" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable >
  19. <el-option v-for="(item,index) in paymentTerm" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  20. </el-select>
  21. <selectComponent v-else-if="item.prop === 'corpId'" :disabled="item.disabled?true:false" v-model="form[item.prop]" :configuration="configuration"/>
  22. <el-input type="textarea" v-else-if="(item.prop === 'remark'||item.prop === 'settlementRemark')"v-model="form[item.prop]" :disabled="item.disabled && item.prop === 'remark'?true:false" size="small" autocomplete="off" placeholder="请输入"></el-input>
  23. <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入"></el-input>
  24. </el-form-item>
  25. </el-col>
  26. </el-row>
  27. </el-form>
  28. </basic-container>
  29. <containerTitle title="明细列表"></containerTitle>
  30. <basic-container>
  31. <avue-crud :option="option"
  32. :data="dataList"
  33. ref="crud"
  34. v-model="form"
  35. :page.sync="page"
  36. :table-loading="loading"
  37. @search-reset="searchReset"
  38. @selection-change="selectionChange"
  39. @current-change="currentChange"
  40. @size-change="sizeChange"
  41. @refresh-change="refreshChange">
  42. <template slot="menuLeft">
  43. <el-button
  44. icon="el-icon-printer"
  45. size="small"
  46. type="primary"
  47. @click.stop="openReport()"
  48. >报表
  49. </el-button>
  50. </template>
  51. <template slot-scope="scope" slot="menu">
  52. <el-button
  53. type="text"
  54. icon="el-icon-check"
  55. size="small"
  56. @click.stop="beforeCloseAccount(scope.row,scope.index)"
  57. >结 算
  58. </el-button>
  59. <el-button
  60. type="text"
  61. icon="el-icon-close"
  62. size="small"
  63. v-if="scope.row.status == 5"
  64. @click.stop="callAccount(scope.row,scope.index)"
  65. >取消结算
  66. </el-button>
  67. </template>
  68. </avue-crud>
  69. </basic-container>
  70. <containerTitle title="附件上传"></containerTitle>
  71. <basic-container style="margin-bottom: 40px">
  72. <avue-crud
  73. :option="upLoadOption"
  74. v-model="upLoadForm"
  75. :data="upLoadData"
  76. @row-save="upLoadSave"
  77. @row-update="upLoadUpdate"
  78. @row-del="upLoadDel"
  79. ></avue-crud>
  80. </basic-container>
  81. </div>
  82. <el-dialog
  83. title="结算"
  84. append-to-body
  85. class="el-dialogDeep"
  86. :visible.sync="accountDialog"
  87. width="25%"
  88. :close-on-click-modal="false"
  89. :destroy-on-close="true"
  90. :close-on-press-escape="false">
  91. <el-form v-model="accountFormData">
  92. <el-form-item label="账户名称:" class="landConFrom-input" prop="accountName">
  93. <el-input v-model="accountFormData.accountName" style="width: 200px;"></el-input>
  94. </el-form-item>
  95. <el-form-item label="开户银行:" class="landConFrom-input" prop="accountBank">
  96. <el-input v-model="accountFormData.accountBank" style="width: 200px;"></el-input>
  97. </el-form-item>
  98. <el-form-item label="银行账号:" class="landConFrom-input" prop="accountNo">
  99. <el-input v-model="accountFormData.accountNo" style="width: 200px;"></el-input>
  100. </el-form-item>
  101. </el-form>
  102. <span slot="footer" style="display: flex; justify-content: center">
  103. <el-button @click.stop="accountDialog = false , accountFormData = {}" size="small">取 消</el-button>
  104. <el-button type="primary" size="small" @click="closeAccount">结算</el-button>
  105. </span>
  106. </el-dialog>
  107. </div>
  108. </template>
  109. <script>
  110. import option from "./configuration/settleAccountsDetailsPage.json";
  111. import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json";
  112. import { projectDetail,updateItemStatus } from "@/api/workManagement/mainProject";
  113. //业务字典
  114. import { getDictionary } from "@/api/system/dictbiz";
  115. export default {
  116. name: "customerInformation",
  117. data() {
  118. return {
  119. loading:false,
  120. accountDialog:false,
  121. aaccount:{},
  122. form: {},
  123. accountFormData:{
  124. accountName:'',
  125. accountBank:'',
  126. accountNo:'',
  127. },
  128. option: option,
  129. parentId:0,
  130. account:{},
  131. paymentTerm:[],
  132. page: {
  133. pageSize: 10,
  134. pagerCount: 5,
  135. total: 0,
  136. },
  137. configuration:{
  138. multipleChoices:false,
  139. multiple:false,
  140. disabled:true,
  141. searchShow:false,
  142. collapseTags:false,
  143. placeholder:'请点击右边按钮选择',
  144. dicData:[]
  145. },
  146. query:{},
  147. //顶部from数据
  148. basicData: {
  149. column: [
  150. {
  151. label: '系统编号',
  152. prop: 'sysNo',
  153. disabled: true,
  154. rules: [
  155. {
  156. required: true,
  157. message: ' ',
  158. trigger: 'blur'
  159. }
  160. ]
  161. }, {
  162. label: '项目编码',
  163. prop: 'code',
  164. disabled: true,
  165. rules: [
  166. {
  167. required: true,
  168. message: ' ',
  169. trigger: 'blur'
  170. }
  171. ]
  172. }, {
  173. label: '项目名称',
  174. prop: 'cname',
  175. disabled: true,
  176. rules: [
  177. {
  178. required: true,
  179. message: ' ',
  180. trigger: 'blur'
  181. }
  182. ]
  183. }, {
  184. label: '客户名称',
  185. prop: 'corpId',
  186. disabled: true,
  187. },{
  188. label: '合同金额',
  189. prop: 'debitAmount',
  190. disabled: true,
  191. rules: [
  192. {
  193. pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
  194. message: ' ',
  195. trigger: 'blur'
  196. }
  197. ]
  198. },
  199. {
  200. label: '首付金额',
  201. prop: 'advanceAmount',
  202. disabled: true,
  203. rules: [
  204. {
  205. pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
  206. message: ' ',
  207. trigger: 'blur'
  208. }
  209. ]
  210. },
  211. {
  212. label: '未收金额',
  213. prop: 'balanceAmount',
  214. disabled: true,
  215. rules: [
  216. {
  217. pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
  218. message: ' ',
  219. trigger: 'blur'
  220. }
  221. ]
  222. },
  223. {
  224. label: '已收金额',
  225. prop: 'settlmentAmount',
  226. disabled: true,
  227. rules: [
  228. {
  229. pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
  230. message: ' ',
  231. trigger: 'blur'
  232. }
  233. ]
  234. },
  235. {
  236. label: '责任人',
  237. prop: 'corpAttn',
  238. disabled: true
  239. }, {
  240. label: '承揽人',
  241. prop: 'salesName',
  242. disabled: true
  243. },
  244. {
  245. label: '制单人',
  246. prop: 'createUserName',
  247. disabled: true
  248. }, {
  249. label: '制单日期',
  250. prop: 'createTime',
  251. type: 'datetime',
  252. disabled: true
  253. },
  254. {
  255. label: '电话',
  256. prop: 'corpTel',
  257. disabled: true,
  258. },
  259. {
  260. label: '收款方式',
  261. prop: 'paymentType',
  262. type:'select',
  263. dataType: "number",
  264. width: 120,
  265. disabled: true,
  266. dicUrl: "/api/blade-system/dict-biz/dictionary?code=affair_payment_term",
  267. props: {
  268. label: "dictValue",
  269. value: "dictKey"
  270. },
  271. },
  272. {
  273. label: '开始日期',
  274. disabled: true,
  275. prop: 'beginTime',
  276. type:'datetime',
  277. },
  278. {
  279. label: '结束日期',
  280. disabled: true,
  281. prop: 'endTime',
  282. type:'datetime',
  283. },
  284. {
  285. label: '备注',
  286. span: 24,
  287. prop: 'remark',
  288. disabled: true,
  289. },
  290. {
  291. label: '结算备注',
  292. span: 24,
  293. prop: 'settlementRemark',
  294. disabled: true,
  295. },
  296. ],
  297. },
  298. //列表假数据
  299. dataList : [],
  300. //上传文件
  301. upLoadOption: upLoadOption,
  302. upLoadData:[],
  303. upLoadForm:{},
  304. }
  305. },
  306. created() {
  307. this.id = BigInt(this.$route.query.id);
  308. this.getProjectDetail();
  309. const params = {
  310. code : "affair_payment_term"
  311. }
  312. getDictionary(params).then(res =>{
  313. this.paymentTerm = res.data.data;
  314. })
  315. },
  316. mounted() {
  317. },
  318. methods: {
  319. getProjectDetail(){
  320. if(this.id){
  321. projectDetail(this.id,"4,5").then(res =>{
  322. this.form = res.data.data;
  323. if(res.data.data.itemList){
  324. this.loading = true;
  325. this.dataList = res.data.data.itemList;
  326. this.loading = false;
  327. }
  328. })
  329. }
  330. },
  331. //结算
  332. beforeCloseAccount(row){
  333. this.aaccount = row;
  334. this.accountDialog = true;
  335. },
  336. closeAccount(){
  337. this.$confirm("确认结算此明细?", {
  338. confirmButtonText: "确定",
  339. cancelButtonText: "取消",
  340. type: "warning"
  341. }).then(() => {
  342. updateItemStatus(this.aaccount.id,5,
  343. this.accountFormData.accountName,
  344. this.accountFormData.accountBank,
  345. this.accountFormData.accountNo,).then(res =>{
  346. if(res.data.success){
  347. this.$message({
  348. type: "success",
  349. message: "操作成功!"
  350. });
  351. this.accountFormData = {},
  352. this.accountDialog = false;
  353. this.getProjectDetail();
  354. }
  355. })
  356. });
  357. },
  358. //结算
  359. callAccount(row,index){
  360. this.$confirm("确认取消结算此明细?", {
  361. confirmButtonText: "确定",
  362. cancelButtonText: "取消",
  363. type: "warning"
  364. }).then(() => {
  365. updateItemStatus(row.id,6).then(res =>{
  366. if(res.data.success){
  367. this.$message({
  368. type: "success",
  369. message: "操作成功!"
  370. });
  371. this.getProjectDetail();
  372. }
  373. })
  374. });
  375. },
  376. //返回列表
  377. backToList(){
  378. this.$router.$avueRouter.closeTag();
  379. this.$router.push({
  380. path: '/workManagement/receipt/settleAccounts',
  381. query: {}
  382. });
  383. },
  384. searchReset() {
  385. console.log('1')
  386. },
  387. selectionChange() {
  388. console.log('1')
  389. },
  390. currentChange() {
  391. console.log('1')
  392. },
  393. sizeChange() {
  394. console.log('1')
  395. },
  396. refreshChange() {
  397. console.log('1')
  398. },
  399. //上传文件保存
  400. upLoadSave(row, done, loading){
  401. this.upLoadData.push(row)
  402. done()
  403. },
  404. //修改附件上传触发
  405. upLoadUpdate(row, done){
  406. done(row);
  407. },
  408. //删除附件上传触发
  409. upLoadDel(row, index,){
  410. this.$confirm("确定将选择数据删除?", {
  411. confirmButtonText: "确定",
  412. cancelButtonText: "取消",
  413. type: "warning"
  414. }).then(() => {
  415. if (row.id){
  416. corpsbank(row.id).then(res=>{
  417. this.$message({
  418. type: "success",
  419. message: "操作成功!"
  420. });
  421. this.bankOfDepositData.splice(index, 1);
  422. })
  423. }else {
  424. this.$message({
  425. type: "success",
  426. message: "操作成功!"
  427. });
  428. this.bankOfDepositData.splice(index, 1);
  429. }
  430. })
  431. },
  432. }
  433. }
  434. </script>
  435. <style scoped lang="scss">
  436. .receipt-head {
  437. position: fixed;
  438. top: 105px;
  439. width: 100%;
  440. margin-left: -10px;
  441. height: 62px;
  442. background: #ffffff;
  443. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  444. z-index: 999;
  445. }
  446. .receipt-back {
  447. cursor: pointer;
  448. line-height: 62px;
  449. font-size: 16px;
  450. color: #323233;
  451. font-weight: 400;
  452. }
  453. ::v-deep .el-form-item {
  454. margin-bottom: 0;
  455. }
  456. .landConFrom-input{
  457. display:flex;
  458. justify-content:center;
  459. }
  460. </style>